objc2_metal_performance_shaders/generated/MPSMatrix/
MPSMatrixSolve.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7use objc2_metal::*;
8
9use crate::*;
10
11extern_class!(
12    /// Dependencies: This depends on Metal.framework.
13    ///
14    ///
15    /// A kernel for computing the solution of a linear system of
16    /// equations using a triangular coefficient matrix.
17    ///
18    ///
19    /// A MPSMatrixSolveTriangular finds the solution matrix to the
20    /// triangular system:
21    ///
22    /// op(A) * X = alpha * B    or    X * op(A) = alpha * B
23    ///
24    /// Where A is either upper or lower triangular and op(A) is A**T
25    /// or A.  B is the array of right hand sides for which the
26    /// equations are to be solved.  X is the resulting matrix of
27    /// solutions.
28    ///
29    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvetriangular?language=objc)
30    #[unsafe(super(MPSMatrixBinaryKernel, MPSKernel, NSObject))]
31    #[derive(Debug, PartialEq, Eq, Hash)]
32    #[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
33    pub struct MPSMatrixSolveTriangular;
34);
35
36#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
37extern_conformance!(
38    unsafe impl NSCoding for MPSMatrixSolveTriangular {}
39);
40
41#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
42extern_conformance!(
43    unsafe impl NSCopying for MPSMatrixSolveTriangular {}
44);
45
46#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
47unsafe impl CopyingHelper for MPSMatrixSolveTriangular {
48    type Result = Self;
49}
50
51#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
52extern_conformance!(
53    unsafe impl NSObjectProtocol for MPSMatrixSolveTriangular {}
54);
55
56#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
57extern_conformance!(
58    unsafe impl NSSecureCoding for MPSMatrixSolveTriangular {}
59);
60
61#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
62impl MPSMatrixSolveTriangular {
63    extern_methods!(
64        /// Initialize an MPSMatrixSolveTriangular object on a device
65        ///
66        ///
67        /// Parameter `device`: The device on which the kernel will execute.
68        ///
69        ///
70        /// Parameter `right`: A boolean value which indicates if the
71        /// coefficient matrix is multiplied on the left
72        /// or right side of the solution.  NO indicates
73        /// the multiplication is on the left.
74        ///
75        ///
76        /// Parameter `upper`: A boolean value which indicates if the source
77        /// is lower or upper triangular.  NO indicates
78        /// that the coefficient matrix is lower triangular.
79        ///
80        ///
81        /// Parameter `transpose`: A boolean value which indicates if the source
82        /// matrix should be used in transposed form.  NO
83        /// indicates that the coefficient matrix is to be
84        /// used normally.
85        ///
86        ///
87        /// Parameter `unit`: A boolean value which indicates if the source
88        /// matrix is unit triangular.
89        ///
90        ///
91        /// Parameter `order`: The order of the source matrix and, if
92        /// right == NO, the number of rows in the solution
93        /// and right hand side matrices.  If right == YES
94        /// the number of columns in the solution and right
95        /// hand side matrices.
96        ///
97        ///
98        /// Parameter `numberOfRightHandSides`: If right == NO, the number of columns in the
99        /// solution and right hand side matrices.  The
100        /// number of rows otherwise.
101        ///
102        ///
103        /// Parameter `alpha`: A double precision value used to scale the right
104        /// hand sides.
105        ///
106        ///
107        /// This function initializes a MPSMatrixSolveTriangular object.  It
108        /// may allocate device side memory.
109        ///
110        ///
111        /// Returns: A valid MPSMatrixSolveTriangular object or nil, if failure.
112        #[unsafe(method(initWithDevice:right:upper:transpose:unit:order:numberOfRightHandSides:alpha:))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn initWithDevice_right_upper_transpose_unit_order_numberOfRightHandSides_alpha(
115            this: Allocated<Self>,
116            device: &ProtocolObject<dyn MTLDevice>,
117            right: bool,
118            upper: bool,
119            transpose: bool,
120            unit: bool,
121            order: NSUInteger,
122            number_of_right_hand_sides: NSUInteger,
123            alpha: c_double,
124        ) -> Retained<Self>;
125
126        /// Encode a MPSMatrixSolveTriangular kernel into a command Buffer.
127        ///
128        ///
129        /// Parameter `commandBuffer`: A valid MTLCommandBuffer to receive the
130        /// encoded filter
131        ///
132        ///
133        /// Parameter `sourceMatrix`: A valid MPSMatrix containing the source
134        /// matrix.
135        ///
136        ///
137        /// Parameter `rightHandSideMatrix`: A valid MPSMatrix containing the right hand
138        /// side values.
139        ///
140        ///
141        /// Parameter `solutionMatrix`: A valid MPSMatrix to contain the result.
142        ///
143        ///
144        /// This function encodes the MPSMatrixSolveTriangular object to a
145        /// valid command buffer.
146        ///
147        /// rightHandSideMatrix and solutionMatrix must be large enough to
148        /// hold at least order * numberOfRightHandSides values starting at
149        /// secondarySourceMatrixOrigin and resultMatrixOrigin respectively.
150        ///
151        /// sourceMatrix must be at least size order x order starting at
152        /// primarySourceMatrixOrigin.
153        #[unsafe(method(encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn encodeToCommandBuffer_sourceMatrix_rightHandSideMatrix_solutionMatrix(
156            &self,
157            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
158            source_matrix: &MPSMatrix,
159            right_hand_side_matrix: &MPSMatrix,
160            solution_matrix: &MPSMatrix,
161        );
162    );
163}
164
165/// Methods declared on superclass `MPSKernel`.
166#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
167impl MPSMatrixSolveTriangular {
168    extern_methods!(
169        /// Standard init with default properties per filter type
170        ///
171        /// Parameter `device`: The device that the filter will be used on. May not be NULL.
172        ///
173        /// Returns: a pointer to the newly initialized object. This will fail, returning
174        /// nil if the device is not supported. Devices must be
175        /// MTLFeatureSet_iOS_GPUFamily2_v1 or later.
176        #[unsafe(method(initWithDevice:))]
177        #[unsafe(method_family = init)]
178        pub unsafe fn initWithDevice(
179            this: Allocated<Self>,
180            device: &ProtocolObject<dyn MTLDevice>,
181        ) -> Retained<Self>;
182
183        /// Called by NSCoder to decode MPSKernels
184        ///
185        /// This isn't the right interface to decode a MPSKernel, but
186        /// it is the one that NSCoder uses. To enable your NSCoder
187        /// (e.g. NSKeyedUnarchiver) to set which device to use
188        /// extend the object to adopt the MPSDeviceProvider
189        /// protocol. Otherwise, the Metal system default device
190        /// will be used.
191        ///
192        /// # Safety
193        ///
194        /// `a_decoder` possibly has further requirements.
195        #[unsafe(method(initWithCoder:))]
196        #[unsafe(method_family = init)]
197        pub unsafe fn initWithCoder(
198            this: Allocated<Self>,
199            a_decoder: &NSCoder,
200        ) -> Option<Retained<Self>>;
201
202        /// NSSecureCoding compatability
203        ///
204        /// While the standard NSSecureCoding/NSCoding method
205        /// -initWithCoder: should work, since the file can't
206        /// know which device your data is allocated on, we
207        /// have to guess and may guess incorrectly.  To avoid
208        /// that problem, use initWithCoder:device instead.
209        ///
210        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
211        ///
212        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
213        ///
214        /// Returns: A new MPSKernel object, or nil if failure.
215        ///
216        /// # Safety
217        ///
218        /// `a_decoder` possibly has further requirements.
219        #[unsafe(method(initWithCoder:device:))]
220        #[unsafe(method_family = init)]
221        pub unsafe fn initWithCoder_device(
222            this: Allocated<Self>,
223            a_decoder: &NSCoder,
224            device: &ProtocolObject<dyn MTLDevice>,
225        ) -> Option<Retained<Self>>;
226    );
227}
228
229/// Methods declared on superclass `NSObject`.
230#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
231impl MPSMatrixSolveTriangular {
232    extern_methods!(
233        #[unsafe(method(init))]
234        #[unsafe(method_family = init)]
235        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
236
237        #[unsafe(method(new))]
238        #[unsafe(method_family = new)]
239        pub unsafe fn new() -> Retained<Self>;
240    );
241}
242
243extern_class!(
244    /// Dependencies: This depends on Metal.framework.
245    ///
246    ///
247    /// A kernel for computing the solution of a linear system of equations
248    /// using the LU factorization resulting from a MPSMatrixDecompositionLU
249    /// kernel.
250    ///
251    ///
252    /// A MPSMatrixSolveLU finds the solution matrix to the system:
253    ///
254    /// op(A) * X = B
255    ///
256    /// Where op(A) is A**T or A.  B is the array of right hand sides for which
257    /// the equations are to be solved.  X is the resulting matrix of solutions.
258    ///
259    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvelu?language=objc)
260    #[unsafe(super(MPSMatrixBinaryKernel, MPSKernel, NSObject))]
261    #[derive(Debug, PartialEq, Eq, Hash)]
262    #[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
263    pub struct MPSMatrixSolveLU;
264);
265
266#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
267extern_conformance!(
268    unsafe impl NSCoding for MPSMatrixSolveLU {}
269);
270
271#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
272extern_conformance!(
273    unsafe impl NSCopying for MPSMatrixSolveLU {}
274);
275
276#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
277unsafe impl CopyingHelper for MPSMatrixSolveLU {
278    type Result = Self;
279}
280
281#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
282extern_conformance!(
283    unsafe impl NSObjectProtocol for MPSMatrixSolveLU {}
284);
285
286#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
287extern_conformance!(
288    unsafe impl NSSecureCoding for MPSMatrixSolveLU {}
289);
290
291#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
292impl MPSMatrixSolveLU {
293    extern_methods!(
294        /// Initialize an MPSMatrixSolveLU object on a device
295        ///
296        ///
297        /// Parameter `device`: The device on which the kernel will execute.
298        ///
299        ///
300        /// Parameter `transpose`: A boolean value which indicates if the source
301        /// matrix should be used in transposed form.
302        ///
303        ///
304        /// Parameter `order`: The order of the source matrix and the number of
305        /// rows in the solution and right hand side matrices.
306        ///
307        ///
308        /// Parameter `numberOfRightHandSides`: The number of columns in the solution and right hand side
309        /// matrices.
310        ///
311        ///
312        /// Returns: A valid MPSMatrixSolveLU object or nil, if failure.
313        #[unsafe(method(initWithDevice:transpose:order:numberOfRightHandSides:))]
314        #[unsafe(method_family = init)]
315        pub unsafe fn initWithDevice_transpose_order_numberOfRightHandSides(
316            this: Allocated<Self>,
317            device: &ProtocolObject<dyn MTLDevice>,
318            transpose: bool,
319            order: NSUInteger,
320            number_of_right_hand_sides: NSUInteger,
321        ) -> Retained<Self>;
322
323        /// Encode a MPSMatrixSolveLU kernel into a command Buffer.
324        ///
325        ///
326        /// Parameter `commandBuffer`: A valid MTLCommandBuffer to receive the encoded filter
327        ///
328        ///
329        /// Parameter `sourceMatrix`: A valid MPSMatrix containing the source matrix in factored
330        /// form as returned by a previous successful execution of a
331        /// MPSMatrixDecompositionLU kernel.
332        ///
333        ///
334        /// Parameter `rightHandSideMatrix`: A valid MPSMatrix containing the right hand side values.
335        ///
336        ///
337        /// Parameter `pivotIndices`: A valid MPSMatrix which contains the pivot indices as returned by
338        /// a previous successful execution of a MPSMatrixDecompositionLU
339        /// kernel.
340        ///
341        ///
342        /// Parameter `solutionMatrix`: A valid MPSMatrix to contain the result.
343        ///
344        ///
345        /// This function encodes the MPSMatrixSolveLU object to a valid command buffer.
346        /// sourceMatrix should contain the lower and upper triangular factors of A as
347        /// results from a previous execution of MPSMatrixDecompositionLU.
348        ///
349        /// pivotIndices is an array of pivots resulting from a previous execution of
350        /// MPSMatrixDecompositionLU.
351        ///
352        /// rightHandSideMatrix and solutionMatrix must be large enough to hold a matrix
353        /// of size order x numberOfRightHandSides starting at secondarySourceMatrixOrigin and
354        /// resultMatrixOrigin respectively.
355        ///
356        /// sourceMatrix must be at least size order x order starting at primarySourceMatrixOrigin.
357        #[unsafe(method(encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:pivotIndices:solutionMatrix:))]
358        #[unsafe(method_family = none)]
359        pub unsafe fn encodeToCommandBuffer_sourceMatrix_rightHandSideMatrix_pivotIndices_solutionMatrix(
360            &self,
361            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
362            source_matrix: &MPSMatrix,
363            right_hand_side_matrix: &MPSMatrix,
364            pivot_indices: &MPSMatrix,
365            solution_matrix: &MPSMatrix,
366        );
367    );
368}
369
370/// Methods declared on superclass `MPSKernel`.
371#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
372impl MPSMatrixSolveLU {
373    extern_methods!(
374        /// Standard init with default properties per filter type
375        ///
376        /// Parameter `device`: The device that the filter will be used on. May not be NULL.
377        ///
378        /// Returns: a pointer to the newly initialized object. This will fail, returning
379        /// nil if the device is not supported. Devices must be
380        /// MTLFeatureSet_iOS_GPUFamily2_v1 or later.
381        #[unsafe(method(initWithDevice:))]
382        #[unsafe(method_family = init)]
383        pub unsafe fn initWithDevice(
384            this: Allocated<Self>,
385            device: &ProtocolObject<dyn MTLDevice>,
386        ) -> Retained<Self>;
387
388        /// Called by NSCoder to decode MPSKernels
389        ///
390        /// This isn't the right interface to decode a MPSKernel, but
391        /// it is the one that NSCoder uses. To enable your NSCoder
392        /// (e.g. NSKeyedUnarchiver) to set which device to use
393        /// extend the object to adopt the MPSDeviceProvider
394        /// protocol. Otherwise, the Metal system default device
395        /// will be used.
396        ///
397        /// # Safety
398        ///
399        /// `a_decoder` possibly has further requirements.
400        #[unsafe(method(initWithCoder:))]
401        #[unsafe(method_family = init)]
402        pub unsafe fn initWithCoder(
403            this: Allocated<Self>,
404            a_decoder: &NSCoder,
405        ) -> Option<Retained<Self>>;
406
407        /// NSSecureCoding compatability
408        ///
409        /// While the standard NSSecureCoding/NSCoding method
410        /// -initWithCoder: should work, since the file can't
411        /// know which device your data is allocated on, we
412        /// have to guess and may guess incorrectly.  To avoid
413        /// that problem, use initWithCoder:device instead.
414        ///
415        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
416        ///
417        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
418        ///
419        /// Returns: A new MPSKernel object, or nil if failure.
420        ///
421        /// # Safety
422        ///
423        /// `a_decoder` possibly has further requirements.
424        #[unsafe(method(initWithCoder:device:))]
425        #[unsafe(method_family = init)]
426        pub unsafe fn initWithCoder_device(
427            this: Allocated<Self>,
428            a_decoder: &NSCoder,
429            device: &ProtocolObject<dyn MTLDevice>,
430        ) -> Option<Retained<Self>>;
431    );
432}
433
434/// Methods declared on superclass `NSObject`.
435#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
436impl MPSMatrixSolveLU {
437    extern_methods!(
438        #[unsafe(method(init))]
439        #[unsafe(method_family = init)]
440        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
441
442        #[unsafe(method(new))]
443        #[unsafe(method_family = new)]
444        pub unsafe fn new() -> Retained<Self>;
445    );
446}
447
448extern_class!(
449    /// Dependencies: This depends on Metal.framework.
450    ///
451    ///
452    /// A kernel for computing the solution of a linear system of equations
453    /// using the Cholesky factorization resulting from a
454    /// MPSMatrixDecompositionCholesky kernel.
455    ///
456    ///
457    /// A MPSMatrixSolveCholesky finds the solution matrix to the system:
458    ///
459    /// A * X = B
460    ///
461    /// Where A is symmetric positive definite.  B is the array of
462    /// right hand sides for which the equations are to be solved.
463    /// X is the resulting matrix of solutions.
464    ///
465    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixsolvecholesky?language=objc)
466    #[unsafe(super(MPSMatrixBinaryKernel, MPSKernel, NSObject))]
467    #[derive(Debug, PartialEq, Eq, Hash)]
468    #[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
469    pub struct MPSMatrixSolveCholesky;
470);
471
472#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
473extern_conformance!(
474    unsafe impl NSCoding for MPSMatrixSolveCholesky {}
475);
476
477#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
478extern_conformance!(
479    unsafe impl NSCopying for MPSMatrixSolveCholesky {}
480);
481
482#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
483unsafe impl CopyingHelper for MPSMatrixSolveCholesky {
484    type Result = Self;
485}
486
487#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
488extern_conformance!(
489    unsafe impl NSObjectProtocol for MPSMatrixSolveCholesky {}
490);
491
492#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
493extern_conformance!(
494    unsafe impl NSSecureCoding for MPSMatrixSolveCholesky {}
495);
496
497#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
498impl MPSMatrixSolveCholesky {
499    extern_methods!(
500        /// Initialize an MPSMatrixSolveCholesky object on a device
501        ///
502        ///
503        /// Parameter `device`: The device on which the kernel will execute.
504        ///
505        ///
506        /// Parameter `upper`: A boolean value which indicates if the source
507        /// matrix stores the lower or upper triangular
508        /// factors.
509        ///
510        ///
511        /// Parameter `order`: The order of the source matrix and the number of
512        /// rows in the solution and right hand side matrices.
513        ///
514        ///
515        /// Parameter `numberOfRightHandSides`: The number of columns in the solution and right hand side
516        /// matrices.
517        ///
518        ///
519        /// Returns: A valid MPSMatrixSolveCholesky object or nil, if failure.
520        #[unsafe(method(initWithDevice:upper:order:numberOfRightHandSides:))]
521        #[unsafe(method_family = init)]
522        pub unsafe fn initWithDevice_upper_order_numberOfRightHandSides(
523            this: Allocated<Self>,
524            device: &ProtocolObject<dyn MTLDevice>,
525            upper: bool,
526            order: NSUInteger,
527            number_of_right_hand_sides: NSUInteger,
528        ) -> Retained<Self>;
529
530        /// Encode a MPSMatrixSolveCholesky kernel into a command Buffer.
531        ///
532        ///
533        /// Parameter `commandBuffer`: A valid MTLCommandBuffer to receive the encoded filter
534        ///
535        ///
536        /// Parameter `sourceMatrix`: A valid MPSMatrix containing the source matrix in factored
537        /// form as returned by a previous successful execution of a
538        /// MPSMatrixDecompositionCholesky kernel.
539        ///
540        ///
541        /// Parameter `rightHandSideMatrix`: A valid MPSMatrix containing the right hand side values.
542        ///
543        ///
544        /// Parameter `solutionMatrix`: A valid MPSMatrix to contain the result.
545        ///
546        ///
547        /// This function encodes the MPSMatrixSolveCholesky object to a valid
548        /// command buffer. sourceMatrix should contain either the lower or upper triangular
549        /// factors corresponding to the factorization returned by a previous execution
550        /// of MPSMatrixDecompositionCholesky.
551        ///
552        /// rightHandSideMatrix and solutionMatrix must be large enough to hold a matrix
553        /// of size order x numberOfRightHandSides starting at secondarySourceMatrixOrigin and
554        /// resultMatrixOrigin respectively.
555        ///
556        /// sourceMatrix must be at least size order x order starting at primarySourceMatrixOrigin.
557        #[unsafe(method(encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:))]
558        #[unsafe(method_family = none)]
559        pub unsafe fn encodeToCommandBuffer_sourceMatrix_rightHandSideMatrix_solutionMatrix(
560            &self,
561            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
562            source_matrix: &MPSMatrix,
563            right_hand_side_matrix: &MPSMatrix,
564            solution_matrix: &MPSMatrix,
565        );
566    );
567}
568
569/// Methods declared on superclass `MPSKernel`.
570#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
571impl MPSMatrixSolveCholesky {
572    extern_methods!(
573        /// Standard init with default properties per filter type
574        ///
575        /// Parameter `device`: The device that the filter will be used on. May not be NULL.
576        ///
577        /// Returns: a pointer to the newly initialized object. This will fail, returning
578        /// nil if the device is not supported. Devices must be
579        /// MTLFeatureSet_iOS_GPUFamily2_v1 or later.
580        #[unsafe(method(initWithDevice:))]
581        #[unsafe(method_family = init)]
582        pub unsafe fn initWithDevice(
583            this: Allocated<Self>,
584            device: &ProtocolObject<dyn MTLDevice>,
585        ) -> Retained<Self>;
586
587        /// Called by NSCoder to decode MPSKernels
588        ///
589        /// This isn't the right interface to decode a MPSKernel, but
590        /// it is the one that NSCoder uses. To enable your NSCoder
591        /// (e.g. NSKeyedUnarchiver) to set which device to use
592        /// extend the object to adopt the MPSDeviceProvider
593        /// protocol. Otherwise, the Metal system default device
594        /// will be used.
595        ///
596        /// # Safety
597        ///
598        /// `a_decoder` possibly has further requirements.
599        #[unsafe(method(initWithCoder:))]
600        #[unsafe(method_family = init)]
601        pub unsafe fn initWithCoder(
602            this: Allocated<Self>,
603            a_decoder: &NSCoder,
604        ) -> Option<Retained<Self>>;
605
606        /// NSSecureCoding compatability
607        ///
608        /// While the standard NSSecureCoding/NSCoding method
609        /// -initWithCoder: should work, since the file can't
610        /// know which device your data is allocated on, we
611        /// have to guess and may guess incorrectly.  To avoid
612        /// that problem, use initWithCoder:device instead.
613        ///
614        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
615        ///
616        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
617        ///
618        /// Returns: A new MPSKernel object, or nil if failure.
619        ///
620        /// # Safety
621        ///
622        /// `a_decoder` possibly has further requirements.
623        #[unsafe(method(initWithCoder:device:))]
624        #[unsafe(method_family = init)]
625        pub unsafe fn initWithCoder_device(
626            this: Allocated<Self>,
627            a_decoder: &NSCoder,
628            device: &ProtocolObject<dyn MTLDevice>,
629        ) -> Option<Retained<Self>>;
630    );
631}
632
633/// Methods declared on superclass `NSObject`.
634#[cfg(all(feature = "MPSCore", feature = "MPSKernel", feature = "MPSMatrixTypes"))]
635impl MPSMatrixSolveCholesky {
636    extern_methods!(
637        #[unsafe(method(init))]
638        #[unsafe(method_family = init)]
639        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
640
641        #[unsafe(method(new))]
642        #[unsafe(method_family = new)]
643        pub unsafe fn new() -> Retained<Self>;
644    );
645}