objc2_metal_performance_shaders/generated/MPSMatrix/
MPSMatrixRandom.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
11/// [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistribution?language=objc)
12// NS_OPTIONS
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct MPSMatrixRandomDistribution(pub NSUInteger);
16bitflags::bitflags! {
17    impl MPSMatrixRandomDistribution: NSUInteger {
18        #[doc(alias = "MPSMatrixRandomDistributionDefault")]
19        const Default = 1;
20        #[doc(alias = "MPSMatrixRandomDistributionUniform")]
21        const Uniform = 2;
22        #[doc(alias = "MPSMatrixRandomDistributionNormal")]
23        const Normal = 3;
24    }
25}
26
27unsafe impl Encode for MPSMatrixRandomDistribution {
28    const ENCODING: Encoding = NSUInteger::ENCODING;
29}
30
31unsafe impl RefEncode for MPSMatrixRandomDistribution {
32    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36    /// Dependencies: This depends on Metal.framework
37    ///
38    /// Decribes properties of a distribution of random values.
39    ///
40    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomdistributiondescriptor?language=objc)
41    #[unsafe(super(NSObject))]
42    #[derive(Debug, PartialEq, Eq, Hash)]
43    pub struct MPSMatrixRandomDistributionDescriptor;
44);
45
46extern_conformance!(
47    unsafe impl NSCopying for MPSMatrixRandomDistributionDescriptor {}
48);
49
50unsafe impl CopyingHelper for MPSMatrixRandomDistributionDescriptor {
51    type Result = Self;
52}
53
54extern_conformance!(
55    unsafe impl NSObjectProtocol for MPSMatrixRandomDistributionDescriptor {}
56);
57
58impl MPSMatrixRandomDistributionDescriptor {
59    extern_methods!(
60        /// The type of distribution.
61        #[unsafe(method(distributionType))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn distributionType(&self) -> MPSMatrixRandomDistribution;
64
65        /// Setter for [`distributionType`][Self::distributionType].
66        #[unsafe(method(setDistributionType:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setDistributionType(&self, distribution_type: MPSMatrixRandomDistribution);
69
70        /// For distributions of values bounded below, this value describes the minimum.
71        #[unsafe(method(minimum))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn minimum(&self) -> c_float;
74
75        /// Setter for [`minimum`][Self::minimum].
76        #[unsafe(method(setMinimum:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setMinimum(&self, minimum: c_float);
79
80        /// For distributions of values bounded above, this value describes the maximum.
81        #[unsafe(method(maximum))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn maximum(&self) -> c_float;
84
85        /// Setter for [`maximum`][Self::maximum].
86        #[unsafe(method(setMaximum:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setMaximum(&self, maximum: c_float);
89
90        /// The value to use for distributions described by their mean.
91        #[unsafe(method(mean))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn mean(&self) -> c_float;
94
95        /// Setter for [`mean`][Self::mean].
96        #[unsafe(method(setMean:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn setMean(&self, mean: c_float);
99
100        /// The value to use for distributions described by their standardDeviation.
101        #[unsafe(method(standardDeviation))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn standardDeviation(&self) -> c_float;
104
105        /// Setter for [`standardDeviation`][Self::standardDeviation].
106        #[unsafe(method(setStandardDeviation:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setStandardDeviation(&self, standard_deviation: c_float);
109
110        /// Make a descriptor for a uniform distribution of floating point values in
111        /// the range [minimum, maximum).
112        ///
113        /// Parameter `minimum`: The lower bound of the range.
114        ///
115        /// Parameter `maximum`: The upper bound of the range.
116        ///
117        /// Returns: A valid MPSMatrixRandomDistribution object or nil, if failure.
118        #[unsafe(method(uniformDistributionDescriptorWithMinimum:maximum:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn uniformDistributionDescriptorWithMinimum_maximum(
121            minimum: c_float,
122            maximum: c_float,
123        ) -> Retained<MPSMatrixRandomDistributionDescriptor>;
124
125        /// Make a descriptor for a normal distribution of floating point values.
126        ///
127        /// Parameter `mean`: The mean of the distribution
128        ///
129        /// Parameter `standardDeviation`: The standard deviation of the distribution.
130        ///
131        /// Returns: A valid MPSMatrixRandomDistribution object or nil if failure.
132        #[unsafe(method(normalDistributionDescriptorWithMean:standardDeviation:))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn normalDistributionDescriptorWithMean_standardDeviation(
135            mean: c_float,
136            standard_deviation: c_float,
137        ) -> Retained<MPSMatrixRandomDistributionDescriptor>;
138
139        /// Make a descriptor for a truncated normal distribution of floating point values.
140        ///
141        /// Parameter `mean`: The mean of the distribution
142        ///
143        /// Parameter `standardDeviation`: The standard deviation of the distribution.
144        ///
145        /// Parameter `minimum`: The lower bound of the distribution
146        ///
147        /// Parameter `maximum`: The upper bound of the distribution
148        ///
149        /// Returns: A valid MPSMatrixRandomDistribution object or nil if failure.
150        #[unsafe(method(normalDistributionDescriptorWithMean:standardDeviation:minimum:maximum:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn normalDistributionDescriptorWithMean_standardDeviation_minimum_maximum(
153            mean: c_float,
154            standard_deviation: c_float,
155            minimum: c_float,
156            maximum: c_float,
157        ) -> Retained<MPSMatrixRandomDistributionDescriptor>;
158
159        /// Make a descriptor for a default distribution.
160        ///
161        /// Returns: A valid MPSMatrixRandomDistribution object or nil, if failure.
162        #[unsafe(method(defaultDistributionDescriptor))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn defaultDistributionDescriptor(
165        ) -> Retained<MPSMatrixRandomDistributionDescriptor>;
166    );
167}
168
169/// Methods declared on superclass `NSObject`.
170impl MPSMatrixRandomDistributionDescriptor {
171    extern_methods!(
172        #[unsafe(method(init))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
175
176        #[unsafe(method(new))]
177        #[unsafe(method_family = new)]
178        pub unsafe fn new() -> Retained<Self>;
179    );
180}
181
182extern_class!(
183    /// Kernels that implement random number generation.
184    ///
185    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandom?language=objc)
186    #[unsafe(super(MPSKernel, NSObject))]
187    #[derive(Debug, PartialEq, Eq, Hash)]
188    #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
189    pub struct MPSMatrixRandom;
190);
191
192#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
193extern_conformance!(
194    unsafe impl NSCoding for MPSMatrixRandom {}
195);
196
197#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
198extern_conformance!(
199    unsafe impl NSCopying for MPSMatrixRandom {}
200);
201
202#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
203unsafe impl CopyingHelper for MPSMatrixRandom {
204    type Result = Self;
205}
206
207#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
208extern_conformance!(
209    unsafe impl NSObjectProtocol for MPSMatrixRandom {}
210);
211
212#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
213extern_conformance!(
214    unsafe impl NSSecureCoding for MPSMatrixRandom {}
215);
216
217#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
218impl MPSMatrixRandom {
219    extern_methods!(
220        #[cfg(feature = "MPSCoreTypes")]
221        /// The type of the data which makes up the values of the result.
222        /// Supported values are:
223        /// MPSDataTypeUInt32
224        /// MPSDataTypeFloat32
225        ///
226        /// Default is MPSDataTypeUInt32
227        #[unsafe(method(destinationDataType))]
228        #[unsafe(method_family = none)]
229        pub unsafe fn destinationDataType(&self) -> MPSDataType;
230
231        /// The distribution from which to generate random values.
232        ///
233        /// Default is MPSMatrixRandomDistributionDefault
234        #[unsafe(method(distributionType))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn distributionType(&self) -> MPSMatrixRandomDistribution;
237
238        /// The starting index in the destination batch.
239        #[unsafe(method(batchStart))]
240        #[unsafe(method_family = none)]
241        pub unsafe fn batchStart(&self) -> NSUInteger;
242
243        /// Setter for [`batchStart`][Self::batchStart].
244        #[unsafe(method(setBatchStart:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn setBatchStart(&self, batch_start: NSUInteger);
247
248        /// The size of the batch to process.
249        #[unsafe(method(batchSize))]
250        #[unsafe(method_family = none)]
251        pub unsafe fn batchSize(&self) -> NSUInteger;
252
253        /// Setter for [`batchSize`][Self::batchSize].
254        #[unsafe(method(setBatchSize:))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn setBatchSize(&self, batch_size: NSUInteger);
257
258        #[unsafe(method(initWithDevice:))]
259        #[unsafe(method_family = init)]
260        pub unsafe fn initWithDevice(
261            this: Allocated<Self>,
262            device: &ProtocolObject<dyn MTLDevice>,
263        ) -> Retained<Self>;
264
265        /// Encode a MPSMatrixRandom kernel into a command Buffer.
266        ///
267        /// Parameter `commandBuffer`: A valid MTLCommandBuffer to receive the encoded filter
268        ///
269        /// Parameter `destinationVector`: A valid MPSVector to contain the result.
270        #[unsafe(method(encodeToCommandBuffer:destinationVector:))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn encodeToCommandBuffer_destinationVector(
273            &self,
274            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
275            destination_vector: &MPSVector,
276        );
277
278        /// Encode a MPSMatrixRandom kernel into a command Buffer.
279        ///
280        /// Parameter `commandBuffer`: A valid MTLCommandBuffer to receive the encoded filter
281        ///
282        /// Parameter `destinationMatrix`: A valid MPSMatrix to contain the result.
283        #[unsafe(method(encodeToCommandBuffer:destinationMatrix:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn encodeToCommandBuffer_destinationMatrix(
286            &self,
287            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
288            destination_matrix: &MPSMatrix,
289        );
290    );
291}
292
293/// Methods declared on superclass `MPSKernel`.
294#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
295impl MPSMatrixRandom {
296    extern_methods!(
297        /// Called by NSCoder to decode MPSKernels
298        ///
299        /// This isn't the right interface to decode a MPSKernel, but
300        /// it is the one that NSCoder uses. To enable your NSCoder
301        /// (e.g. NSKeyedUnarchiver) to set which device to use
302        /// extend the object to adopt the MPSDeviceProvider
303        /// protocol. Otherwise, the Metal system default device
304        /// will be used.
305        ///
306        /// # Safety
307        ///
308        /// `a_decoder` possibly has further requirements.
309        #[unsafe(method(initWithCoder:))]
310        #[unsafe(method_family = init)]
311        pub unsafe fn initWithCoder(
312            this: Allocated<Self>,
313            a_decoder: &NSCoder,
314        ) -> Option<Retained<Self>>;
315
316        /// NSSecureCoding compatability
317        ///
318        /// While the standard NSSecureCoding/NSCoding method
319        /// -initWithCoder: should work, since the file can't
320        /// know which device your data is allocated on, we
321        /// have to guess and may guess incorrectly.  To avoid
322        /// that problem, use initWithCoder:device instead.
323        ///
324        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
325        ///
326        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
327        ///
328        /// Returns: A new MPSKernel object, or nil if failure.
329        ///
330        /// # Safety
331        ///
332        /// `a_decoder` possibly has further requirements.
333        #[unsafe(method(initWithCoder:device:))]
334        #[unsafe(method_family = init)]
335        pub unsafe fn initWithCoder_device(
336            this: Allocated<Self>,
337            a_decoder: &NSCoder,
338            device: &ProtocolObject<dyn MTLDevice>,
339        ) -> Option<Retained<Self>>;
340    );
341}
342
343/// Methods declared on superclass `NSObject`.
344#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
345impl MPSMatrixRandom {
346    extern_methods!(
347        #[unsafe(method(init))]
348        #[unsafe(method_family = init)]
349        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
350
351        #[unsafe(method(new))]
352        #[unsafe(method_family = new)]
353        pub unsafe fn new() -> Retained<Self>;
354    );
355}
356
357extern_class!(
358    /// Generates random numbers using a Mersenne Twister algorithm
359    /// suitable for GPU execution.  It uses a period of 2**11214.
360    /// For further details see:
361    /// Mutsuo Saito. A Variant of Mersenne Twister Suitable for Graphic Processors. arXiv:1005.4973
362    ///
363    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandommtgp32?language=objc)
364    #[unsafe(super(MPSMatrixRandom, MPSKernel, NSObject))]
365    #[derive(Debug, PartialEq, Eq, Hash)]
366    #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
367    pub struct MPSMatrixRandomMTGP32;
368);
369
370#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
371extern_conformance!(
372    unsafe impl NSCoding for MPSMatrixRandomMTGP32 {}
373);
374
375#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
376extern_conformance!(
377    unsafe impl NSCopying for MPSMatrixRandomMTGP32 {}
378);
379
380#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
381unsafe impl CopyingHelper for MPSMatrixRandomMTGP32 {
382    type Result = Self;
383}
384
385#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
386extern_conformance!(
387    unsafe impl NSObjectProtocol for MPSMatrixRandomMTGP32 {}
388);
389
390#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
391extern_conformance!(
392    unsafe impl NSSecureCoding for MPSMatrixRandomMTGP32 {}
393);
394
395#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
396impl MPSMatrixRandomMTGP32 {
397    extern_methods!(
398        /// initialize a MPSMatrixRandomMTGP32 filter to generate 32-bit unsigned
399        /// integer values with an initial seed of 0.
400        ///
401        /// Parameter `device`: The device the filter will run on
402        #[unsafe(method(initWithDevice:))]
403        #[unsafe(method_family = init)]
404        pub unsafe fn initWithDevice(
405            this: Allocated<Self>,
406            device: &ProtocolObject<dyn MTLDevice>,
407        ) -> Retained<Self>;
408
409        #[cfg(feature = "MPSCoreTypes")]
410        /// initialize a MPSMatrixRandomMTGP32 filter
411        ///
412        /// Parameter `device`: The device the filter will run on
413        ///
414        /// Parameter `destinationDataType`: The data type of the result.
415        ///
416        /// Parameter `seed`: The seed to initialize the random number generators with.
417        ///
418        /// Parameter `distributionDescriptor`: A descriptor containing information about the distribution.
419        #[unsafe(method(initWithDevice:destinationDataType:seed:distributionDescriptor:))]
420        #[unsafe(method_family = init)]
421        pub unsafe fn initWithDevice_destinationDataType_seed_distributionDescriptor(
422            this: Allocated<Self>,
423            device: &ProtocolObject<dyn MTLDevice>,
424            destination_data_type: MPSDataType,
425            seed: NSUInteger,
426            distribution_descriptor: &MPSMatrixRandomDistributionDescriptor,
427        ) -> Retained<Self>;
428
429        /// Synchronize internal MTGP32 state between GPU and CPU.
430        ///
431        /// Parameter `commandBuffer`: The command buffer on which to encode the synchronization.
432        #[unsafe(method(synchronizeStateOnCommandBuffer:))]
433        #[unsafe(method_family = none)]
434        pub unsafe fn synchronizeStateOnCommandBuffer(
435            &self,
436            command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
437        );
438
439        #[cfg(feature = "MPSCoreTypes")]
440        /// initialize a MPSMatrixRandomMTGP32 filter using a default distribution.
441        ///
442        /// Parameter `device`: The device the filter will run on
443        ///
444        /// Parameter `destinationDataType`: The data type of the result.
445        ///
446        /// Parameter `seed`: The seed to initialize the random number generators with.
447        #[unsafe(method(initWithDevice:destinationDataType:seed:))]
448        #[unsafe(method_family = init)]
449        pub unsafe fn initWithDevice_destinationDataType_seed(
450            this: Allocated<Self>,
451            device: &ProtocolObject<dyn MTLDevice>,
452            destination_data_type: MPSDataType,
453            seed: NSUInteger,
454        ) -> Retained<Self>;
455
456        /// # Safety
457        ///
458        /// `a_decoder` possibly has further requirements.
459        #[unsafe(method(initWithCoder:device:))]
460        #[unsafe(method_family = init)]
461        pub unsafe fn initWithCoder_device(
462            this: Allocated<Self>,
463            a_decoder: &NSCoder,
464            device: &ProtocolObject<dyn MTLDevice>,
465        ) -> Option<Retained<Self>>;
466    );
467}
468
469/// Methods declared on superclass `MPSKernel`.
470#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
471impl MPSMatrixRandomMTGP32 {
472    extern_methods!(
473        /// Called by NSCoder to decode MPSKernels
474        ///
475        /// This isn't the right interface to decode a MPSKernel, but
476        /// it is the one that NSCoder uses. To enable your NSCoder
477        /// (e.g. NSKeyedUnarchiver) to set which device to use
478        /// extend the object to adopt the MPSDeviceProvider
479        /// protocol. Otherwise, the Metal system default device
480        /// will be used.
481        ///
482        /// # Safety
483        ///
484        /// `a_decoder` possibly has further requirements.
485        #[unsafe(method(initWithCoder:))]
486        #[unsafe(method_family = init)]
487        pub unsafe fn initWithCoder(
488            this: Allocated<Self>,
489            a_decoder: &NSCoder,
490        ) -> Option<Retained<Self>>;
491    );
492}
493
494/// Methods declared on superclass `NSObject`.
495#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
496impl MPSMatrixRandomMTGP32 {
497    extern_methods!(
498        #[unsafe(method(init))]
499        #[unsafe(method_family = init)]
500        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
501
502        #[unsafe(method(new))]
503        #[unsafe(method_family = new)]
504        pub unsafe fn new() -> Retained<Self>;
505    );
506}
507
508extern_class!(
509    /// Generates random numbers using a counter based algorithm.
510    /// For further details see:
511    /// John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw. Parallel Random Numbers: As Easy as 1, 2, 3.
512    ///
513    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsmatrixrandomphilox?language=objc)
514    #[unsafe(super(MPSMatrixRandom, MPSKernel, NSObject))]
515    #[derive(Debug, PartialEq, Eq, Hash)]
516    #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
517    pub struct MPSMatrixRandomPhilox;
518);
519
520#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
521extern_conformance!(
522    unsafe impl NSCoding for MPSMatrixRandomPhilox {}
523);
524
525#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
526extern_conformance!(
527    unsafe impl NSCopying for MPSMatrixRandomPhilox {}
528);
529
530#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
531unsafe impl CopyingHelper for MPSMatrixRandomPhilox {
532    type Result = Self;
533}
534
535#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
536extern_conformance!(
537    unsafe impl NSObjectProtocol for MPSMatrixRandomPhilox {}
538);
539
540#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
541extern_conformance!(
542    unsafe impl NSSecureCoding for MPSMatrixRandomPhilox {}
543);
544
545#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
546impl MPSMatrixRandomPhilox {
547    extern_methods!(
548        /// initialize a MPSMatrixRandomPhilox filter to generate 32-bit unsigned
549        /// integer values with an initial seed of 0.
550        ///
551        /// Parameter `device`: The device the filter will run on
552        #[unsafe(method(initWithDevice:))]
553        #[unsafe(method_family = init)]
554        pub unsafe fn initWithDevice(
555            this: Allocated<Self>,
556            device: &ProtocolObject<dyn MTLDevice>,
557        ) -> Retained<Self>;
558
559        #[cfg(feature = "MPSCoreTypes")]
560        /// initialize a MPSMatrixRandomPhilox filter
561        ///
562        /// Parameter `device`: The device the filter will run on
563        ///
564        /// Parameter `destinationDataType`: The data type of the result.
565        ///
566        /// Parameter `seed`: The seed to initialize the random number generators with.
567        ///
568        /// Parameter `distributionDescriptor`: A descriptor containing information about the distribution.
569        #[unsafe(method(initWithDevice:destinationDataType:seed:distributionDescriptor:))]
570        #[unsafe(method_family = init)]
571        pub unsafe fn initWithDevice_destinationDataType_seed_distributionDescriptor(
572            this: Allocated<Self>,
573            device: &ProtocolObject<dyn MTLDevice>,
574            destination_data_type: MPSDataType,
575            seed: NSUInteger,
576            distribution_descriptor: &MPSMatrixRandomDistributionDescriptor,
577        ) -> Retained<Self>;
578
579        #[cfg(feature = "MPSCoreTypes")]
580        /// initialize a MPSMatrixRandomPhilox filter using a default distribution.
581        ///
582        /// Parameter `device`: The device the filter will run on
583        ///
584        /// Parameter `destinationDataType`: The data type of the result.
585        ///
586        /// Parameter `seed`: The seed to initialize the random number generators with.
587        #[unsafe(method(initWithDevice:destinationDataType:seed:))]
588        #[unsafe(method_family = init)]
589        pub unsafe fn initWithDevice_destinationDataType_seed(
590            this: Allocated<Self>,
591            device: &ProtocolObject<dyn MTLDevice>,
592            destination_data_type: MPSDataType,
593            seed: NSUInteger,
594        ) -> Retained<Self>;
595
596        /// # Safety
597        ///
598        /// `a_decoder` possibly has further requirements.
599        #[unsafe(method(initWithCoder:device:))]
600        #[unsafe(method_family = init)]
601        pub unsafe fn initWithCoder_device(
602            this: Allocated<Self>,
603            a_decoder: &NSCoder,
604            device: &ProtocolObject<dyn MTLDevice>,
605        ) -> Option<Retained<Self>>;
606    );
607}
608
609/// Methods declared on superclass `MPSKernel`.
610#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
611impl MPSMatrixRandomPhilox {
612    extern_methods!(
613        /// Called by NSCoder to decode MPSKernels
614        ///
615        /// This isn't the right interface to decode a MPSKernel, but
616        /// it is the one that NSCoder uses. To enable your NSCoder
617        /// (e.g. NSKeyedUnarchiver) to set which device to use
618        /// extend the object to adopt the MPSDeviceProvider
619        /// protocol. Otherwise, the Metal system default device
620        /// will be used.
621        ///
622        /// # Safety
623        ///
624        /// `a_decoder` possibly has further requirements.
625        #[unsafe(method(initWithCoder:))]
626        #[unsafe(method_family = init)]
627        pub unsafe fn initWithCoder(
628            this: Allocated<Self>,
629            a_decoder: &NSCoder,
630        ) -> Option<Retained<Self>>;
631    );
632}
633
634/// Methods declared on superclass `NSObject`.
635#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
636impl MPSMatrixRandomPhilox {
637    extern_methods!(
638        #[unsafe(method(init))]
639        #[unsafe(method_family = init)]
640        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
641
642        #[unsafe(method(new))]
643        #[unsafe(method_family = new)]
644        pub unsafe fn new() -> Retained<Self>;
645    );
646}