1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7use objc2_metal::*;
8
9use crate::*;
10
11extern_class!(
12 #[unsafe(super(MPSKernel, NSObject))]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
16 pub struct MPSNDArrayMultiaryBase;
17);
18
19#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
20extern_conformance!(
21 unsafe impl NSCoding for MPSNDArrayMultiaryBase {}
22);
23
24#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
25extern_conformance!(
26 unsafe impl NSCopying for MPSNDArrayMultiaryBase {}
27);
28
29#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
30unsafe impl CopyingHelper for MPSNDArrayMultiaryBase {
31 type Result = Self;
32}
33
34#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
35extern_conformance!(
36 unsafe impl NSObjectProtocol for MPSNDArrayMultiaryBase {}
37);
38
39#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
40extern_conformance!(
41 unsafe impl NSSecureCoding for MPSNDArrayMultiaryBase {}
42);
43
44#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
45impl MPSNDArrayMultiaryBase {
46 extern_methods!(
47 #[cfg(feature = "MPSNDArrayTypes")]
48 #[deprecated]
58 #[unsafe(method(offsetsAtSourceIndex:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn offsetsAtSourceIndex(&self, source_index: NSUInteger) -> MPSNDArrayOffsets;
61
62 #[cfg(feature = "MPSCoreTypes")]
63 #[deprecated]
69 #[unsafe(method(edgeModeAtSourceIndex:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn edgeModeAtSourceIndex(&self, source_index: NSUInteger) -> MPSImageEdgeMode;
72
73 #[cfg(feature = "MPSNDArrayTypes")]
74 #[deprecated]
80 #[unsafe(method(kernelSizesForSourceIndex:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn kernelSizesForSourceIndex(&self, source_index: NSUInteger)
83 -> MPSNDArraySizes;
84
85 #[cfg(feature = "MPSNDArrayTypes")]
86 #[deprecated]
97 #[unsafe(method(stridesForSourceIndex:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn stridesForSourceIndex(&self, source_index: NSUInteger) -> MPSNDArrayOffsets;
100
101 #[cfg(feature = "MPSNDArrayTypes")]
102 #[deprecated]
108 #[unsafe(method(dilationRatesForSourceIndex:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn dilationRatesForSourceIndex(
111 &self,
112 source_index: NSUInteger,
113 ) -> MPSNDArraySizes;
114
115 #[unsafe(method(destinationArrayAllocator))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn destinationArrayAllocator(
121 &self,
122 ) -> Retained<ProtocolObject<dyn MPSNDArrayAllocator>>;
123
124 #[unsafe(method(setDestinationArrayAllocator:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn setDestinationArrayAllocator(
128 &self,
129 destination_array_allocator: &ProtocolObject<dyn MPSNDArrayAllocator>,
130 );
131
132 #[unsafe(method(initWithDevice:))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn initWithDevice(
135 this: Allocated<Self>,
136 device: &ProtocolObject<dyn MTLDevice>,
137 ) -> Retained<Self>;
138
139 #[unsafe(method(initWithDevice:sourceCount:))]
147 #[unsafe(method_family = init)]
148 pub unsafe fn initWithDevice_sourceCount(
149 this: Allocated<Self>,
150 device: &ProtocolObject<dyn MTLDevice>,
151 count: NSUInteger,
152 ) -> Retained<Self>;
153
154 #[unsafe(method(initWithCoder:device:))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn initWithCoder_device(
168 this: Allocated<Self>,
169 coder: &NSCoder,
170 device: &ProtocolObject<dyn MTLDevice>,
171 ) -> Retained<Self>;
172
173 #[unsafe(method(encodeWithCoder:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn encodeWithCoder(&self, coder: &NSCoder);
183
184 #[unsafe(method(copyWithZone:device:))]
196 #[unsafe(method_family = copy)]
197 pub unsafe fn copyWithZone_device(
198 &self,
199 zone: *mut NSZone,
200 device: Option<&ProtocolObject<dyn MTLDevice>>,
201 ) -> Retained<Self>;
202
203 #[cfg(feature = "MPSState")]
204 #[unsafe(method(resultStateForSourceArrays:sourceStates:destinationArray:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn resultStateForSourceArrays_sourceStates_destinationArray(
207 &self,
208 source_arrays: &NSArray<MPSNDArray>,
209 source_states: Option<&NSArray<MPSState>>,
210 destination_array: &MPSNDArray,
211 ) -> Option<Retained<MPSState>>;
212
213 #[cfg(feature = "MPSState")]
214 #[unsafe(method(destinationArrayDescriptorForSourceArrays:sourceState:))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn destinationArrayDescriptorForSourceArrays_sourceState(
229 &self,
230 sources: &NSArray<MPSNDArray>,
231 state: Option<&MPSState>,
232 ) -> Retained<MPSNDArrayDescriptor>;
233 );
234}
235
236#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
238impl MPSNDArrayMultiaryBase {
239 extern_methods!(
240 #[unsafe(method(initWithCoder:))]
253 #[unsafe(method_family = init)]
254 pub unsafe fn initWithCoder(
255 this: Allocated<Self>,
256 a_decoder: &NSCoder,
257 ) -> Option<Retained<Self>>;
258 );
259}
260
261#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
263impl MPSNDArrayMultiaryBase {
264 extern_methods!(
265 #[unsafe(method(init))]
266 #[unsafe(method_family = init)]
267 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
268
269 #[unsafe(method(new))]
270 #[unsafe(method_family = new)]
271 pub unsafe fn new() -> Retained<Self>;
272 );
273}
274
275extern_class!(
276 #[unsafe(super(MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
278 #[derive(Debug, PartialEq, Eq, Hash)]
279 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
280 pub struct MPSNDArrayMultiaryKernel;
281);
282
283#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
284extern_conformance!(
285 unsafe impl NSCoding for MPSNDArrayMultiaryKernel {}
286);
287
288#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
289extern_conformance!(
290 unsafe impl NSCopying for MPSNDArrayMultiaryKernel {}
291);
292
293#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
294unsafe impl CopyingHelper for MPSNDArrayMultiaryKernel {
295 type Result = Self;
296}
297
298#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
299extern_conformance!(
300 unsafe impl NSObjectProtocol for MPSNDArrayMultiaryKernel {}
301);
302
303#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
304extern_conformance!(
305 unsafe impl NSSecureCoding for MPSNDArrayMultiaryKernel {}
306);
307
308#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
309impl MPSNDArrayMultiaryKernel {
310 extern_methods!(
311 #[unsafe(method(initWithDevice:sourceCount:))]
312 #[unsafe(method_family = init)]
313 pub unsafe fn initWithDevice_sourceCount(
314 this: Allocated<Self>,
315 device: &ProtocolObject<dyn MTLDevice>,
316 count: NSUInteger,
317 ) -> Retained<Self>;
318
319 #[unsafe(method(initWithCoder:device:))]
323 #[unsafe(method_family = init)]
324 pub unsafe fn initWithCoder_device(
325 this: Allocated<Self>,
326 coder: &NSCoder,
327 device: &ProtocolObject<dyn MTLDevice>,
328 ) -> Retained<Self>;
329
330 #[unsafe(method(encodeToCommandBuffer:sourceArrays:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn encodeToCommandBuffer_sourceArrays(
342 &self,
343 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
344 source_arrays: &NSArray<MPSNDArray>,
345 ) -> Retained<MPSNDArray>;
346
347 #[unsafe(method(encodeToCommandBuffer:sourceArrays:destinationArray:))]
356 #[unsafe(method_family = none)]
357 pub unsafe fn encodeToCommandBuffer_sourceArrays_destinationArray(
358 &self,
359 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
360 source_arrays: &NSArray<MPSNDArray>,
361 destination: &MPSNDArray,
362 );
363
364 #[cfg(feature = "MPSState")]
365 #[unsafe(method(encodeToCommandBuffer:sourceArrays:resultState:outputStateIsTemporary:))]
379 #[unsafe(method_family = none)]
380 pub unsafe fn encodeToCommandBuffer_sourceArrays_resultState_outputStateIsTemporary(
381 &self,
382 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
383 source_arrays: &NSArray<MPSNDArray>,
384 out_gradient_state: Option<&mut Option<Retained<MPSState>>>,
385 output_state_is_temporary: bool,
386 ) -> Retained<MPSNDArray>;
387
388 #[cfg(feature = "MPSState")]
389 #[unsafe(method(encodeToCommandBuffer:sourceArrays:resultState:destinationArray:))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn encodeToCommandBuffer_sourceArrays_resultState_destinationArray(
403 &self,
404 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
405 source_arrays: &NSArray<MPSNDArray>,
406 out_gradient_state: Option<&MPSState>,
407 destination: &MPSNDArray,
408 );
409
410 #[unsafe(method(encodeToCommandEncoder:commandBuffer:sourceArrays:destinationArray:))]
422 #[unsafe(method_family = none)]
423 pub unsafe fn encodeToCommandEncoder_commandBuffer_sourceArrays_destinationArray(
424 &self,
425 encoder: Option<&ProtocolObject<dyn MTLComputeCommandEncoder>>,
426 command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
427 source_arrays: &NSArray<MPSNDArray>,
428 destination: &MPSNDArray,
429 );
430 );
431}
432
433#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
435impl MPSNDArrayMultiaryKernel {
436 extern_methods!(
437 #[unsafe(method(initWithDevice:))]
438 #[unsafe(method_family = init)]
439 pub unsafe fn initWithDevice(
440 this: Allocated<Self>,
441 device: &ProtocolObject<dyn MTLDevice>,
442 ) -> Retained<Self>;
443 );
444}
445
446#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
448impl MPSNDArrayMultiaryKernel {
449 extern_methods!(
450 #[unsafe(method(initWithCoder:))]
463 #[unsafe(method_family = init)]
464 pub unsafe fn initWithCoder(
465 this: Allocated<Self>,
466 a_decoder: &NSCoder,
467 ) -> Option<Retained<Self>>;
468 );
469}
470
471#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
473impl MPSNDArrayMultiaryKernel {
474 extern_methods!(
475 #[unsafe(method(init))]
476 #[unsafe(method_family = init)]
477 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
478
479 #[unsafe(method(new))]
480 #[unsafe(method_family = new)]
481 pub unsafe fn new() -> Retained<Self>;
482 );
483}
484
485extern_class!(
486 #[unsafe(super(MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
488 #[derive(Debug, PartialEq, Eq, Hash)]
489 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
490 pub struct MPSNDArrayMultiaryGradientKernel;
491);
492
493#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
494extern_conformance!(
495 unsafe impl NSCoding for MPSNDArrayMultiaryGradientKernel {}
496);
497
498#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
499extern_conformance!(
500 unsafe impl NSCopying for MPSNDArrayMultiaryGradientKernel {}
501);
502
503#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
504unsafe impl CopyingHelper for MPSNDArrayMultiaryGradientKernel {
505 type Result = Self;
506}
507
508#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
509extern_conformance!(
510 unsafe impl NSObjectProtocol for MPSNDArrayMultiaryGradientKernel {}
511);
512
513#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
514extern_conformance!(
515 unsafe impl NSSecureCoding for MPSNDArrayMultiaryGradientKernel {}
516);
517
518#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
519impl MPSNDArrayMultiaryGradientKernel {
520 extern_methods!(
521 #[unsafe(method(initWithDevice:sourceCount:))]
522 #[unsafe(method_family = init)]
523 pub unsafe fn initWithDevice_sourceCount(
524 this: Allocated<Self>,
525 device: &ProtocolObject<dyn MTLDevice>,
526 count: NSUInteger,
527 ) -> Retained<Self>;
528
529 #[unsafe(method(initWithCoder:device:))]
533 #[unsafe(method_family = init)]
534 pub unsafe fn initWithCoder_device(
535 this: Allocated<Self>,
536 coder: &NSCoder,
537 device: &ProtocolObject<dyn MTLDevice>,
538 ) -> Retained<Self>;
539
540 #[unsafe(method(initWithDevice:sourceCount:sourceGradientIndex:))]
550 #[unsafe(method_family = init)]
551 pub unsafe fn initWithDevice_sourceCount_sourceGradientIndex(
552 this: Allocated<Self>,
553 device: &ProtocolObject<dyn MTLDevice>,
554 count: NSUInteger,
555 source_gradient_index: NSUInteger,
556 ) -> Retained<Self>;
557
558 #[cfg(feature = "MPSState")]
559 #[unsafe(method(encodeToCommandBuffer:sourceArrays:sourceGradient:gradientState:))]
560 #[unsafe(method_family = none)]
561 pub unsafe fn encodeToCommandBuffer_sourceArrays_sourceGradient_gradientState(
562 &self,
563 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
564 sources: &NSArray<MPSNDArray>,
565 gradient: &MPSNDArray,
566 state: &MPSState,
567 ) -> Retained<MPSNDArray>;
568
569 #[cfg(feature = "MPSState")]
570 #[unsafe(method(encodeToCommandBuffer:sourceArrays:sourceGradient:gradientState:destinationArray:))]
571 #[unsafe(method_family = none)]
572 pub unsafe fn encodeToCommandBuffer_sourceArrays_sourceGradient_gradientState_destinationArray(
573 &self,
574 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
575 sources: &NSArray<MPSNDArray>,
576 gradient: &MPSNDArray,
577 state: &MPSState,
578 destination: &MPSNDArray,
579 );
580 );
581}
582
583#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
585impl MPSNDArrayMultiaryGradientKernel {
586 extern_methods!(
587 #[unsafe(method(initWithDevice:))]
588 #[unsafe(method_family = init)]
589 pub unsafe fn initWithDevice(
590 this: Allocated<Self>,
591 device: &ProtocolObject<dyn MTLDevice>,
592 ) -> Retained<Self>;
593 );
594}
595
596#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
598impl MPSNDArrayMultiaryGradientKernel {
599 extern_methods!(
600 #[unsafe(method(initWithCoder:))]
613 #[unsafe(method_family = init)]
614 pub unsafe fn initWithCoder(
615 this: Allocated<Self>,
616 a_decoder: &NSCoder,
617 ) -> Option<Retained<Self>>;
618 );
619}
620
621#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
623impl MPSNDArrayMultiaryGradientKernel {
624 extern_methods!(
625 #[unsafe(method(init))]
626 #[unsafe(method_family = init)]
627 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
628
629 #[unsafe(method(new))]
630 #[unsafe(method_family = new)]
631 pub unsafe fn new() -> Retained<Self>;
632 );
633}
634
635extern_class!(
636 #[unsafe(super(MPSNDArrayMultiaryKernel, MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
638 #[derive(Debug, PartialEq, Eq, Hash)]
639 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
640 pub struct MPSNDArrayUnaryKernel;
641);
642
643#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
644extern_conformance!(
645 unsafe impl NSCoding for MPSNDArrayUnaryKernel {}
646);
647
648#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
649extern_conformance!(
650 unsafe impl NSCopying for MPSNDArrayUnaryKernel {}
651);
652
653#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
654unsafe impl CopyingHelper for MPSNDArrayUnaryKernel {
655 type Result = Self;
656}
657
658#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
659extern_conformance!(
660 unsafe impl NSObjectProtocol for MPSNDArrayUnaryKernel {}
661);
662
663#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
664extern_conformance!(
665 unsafe impl NSSecureCoding for MPSNDArrayUnaryKernel {}
666);
667
668#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
669impl MPSNDArrayUnaryKernel {
670 extern_methods!(
671 #[cfg(feature = "MPSNDArrayTypes")]
672 #[deprecated]
679 #[unsafe(method(offsets))]
680 #[unsafe(method_family = none)]
681 pub unsafe fn offsets(&self) -> MPSNDArrayOffsets;
682
683 #[cfg(feature = "MPSCoreTypes")]
684 #[deprecated]
687 #[unsafe(method(edgeMode))]
688 #[unsafe(method_family = none)]
689 pub unsafe fn edgeMode(&self) -> MPSImageEdgeMode;
690
691 #[cfg(feature = "MPSNDArrayTypes")]
692 #[deprecated]
695 #[unsafe(method(kernelSizes))]
696 #[unsafe(method_family = none)]
697 pub unsafe fn kernelSizes(&self) -> MPSNDArraySizes;
698
699 #[cfg(feature = "MPSNDArrayTypes")]
700 #[deprecated]
705 #[unsafe(method(strides))]
706 #[unsafe(method_family = none)]
707 pub unsafe fn strides(&self) -> MPSNDArrayOffsets;
708
709 #[cfg(feature = "MPSNDArrayTypes")]
710 #[deprecated]
713 #[unsafe(method(dilationRates))]
714 #[unsafe(method_family = none)]
715 pub unsafe fn dilationRates(&self) -> MPSNDArraySizes;
716
717 #[unsafe(method(initWithDevice:))]
718 #[unsafe(method_family = init)]
719 pub unsafe fn initWithDevice(
720 this: Allocated<Self>,
721 device: &ProtocolObject<dyn MTLDevice>,
722 ) -> Retained<Self>;
723
724 #[unsafe(method(initWithDevice:sourceCount:))]
725 #[unsafe(method_family = init)]
726 pub unsafe fn initWithDevice_sourceCount(
727 this: Allocated<Self>,
728 device: &ProtocolObject<dyn MTLDevice>,
729 count: NSUInteger,
730 ) -> Retained<Self>;
731
732 #[unsafe(method(initWithCoder:device:))]
736 #[unsafe(method_family = init)]
737 pub unsafe fn initWithCoder_device(
738 this: Allocated<Self>,
739 coder: &NSCoder,
740 device: &ProtocolObject<dyn MTLDevice>,
741 ) -> Retained<Self>;
742
743 #[unsafe(method(encodeToCommandBuffer:sourceArray:))]
752 #[unsafe(method_family = none)]
753 pub unsafe fn encodeToCommandBuffer_sourceArray(
754 &self,
755 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
756 source_array: &MPSNDArray,
757 ) -> Retained<MPSNDArray>;
758
759 #[unsafe(method(encodeToCommandBuffer:sourceArray:destinationArray:))]
767 #[unsafe(method_family = none)]
768 pub unsafe fn encodeToCommandBuffer_sourceArray_destinationArray(
769 &self,
770 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
771 source_array: &MPSNDArray,
772 destination: &MPSNDArray,
773 );
774
775 #[cfg(feature = "MPSState")]
776 #[unsafe(method(encodeToCommandBuffer:sourceArray:resultState:outputStateIsTemporary:))]
789 #[unsafe(method_family = none)]
790 pub unsafe fn encodeToCommandBuffer_sourceArray_resultState_outputStateIsTemporary(
791 &self,
792 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
793 source_array: &MPSNDArray,
794 out_gradient_state: Option<&mut Option<Retained<MPSState>>>,
795 output_state_is_temporary: bool,
796 ) -> Retained<MPSNDArray>;
797
798 #[cfg(feature = "MPSState")]
799 #[unsafe(method(encodeToCommandBuffer:sourceArray:resultState:destinationArray:))]
810 #[unsafe(method_family = none)]
811 pub unsafe fn encodeToCommandBuffer_sourceArray_resultState_destinationArray(
812 &self,
813 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
814 source_array: &MPSNDArray,
815 out_gradient_state: Option<&MPSState>,
816 destination: &MPSNDArray,
817 );
818 );
819}
820
821#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
823impl MPSNDArrayUnaryKernel {
824 extern_methods!(
825 #[unsafe(method(initWithCoder:))]
838 #[unsafe(method_family = init)]
839 pub unsafe fn initWithCoder(
840 this: Allocated<Self>,
841 a_decoder: &NSCoder,
842 ) -> Option<Retained<Self>>;
843 );
844}
845
846#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
848impl MPSNDArrayUnaryKernel {
849 extern_methods!(
850 #[unsafe(method(init))]
851 #[unsafe(method_family = init)]
852 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
853
854 #[unsafe(method(new))]
855 #[unsafe(method_family = new)]
856 pub unsafe fn new() -> Retained<Self>;
857 );
858}
859
860extern_class!(
861 #[unsafe(super(
863 MPSNDArrayMultiaryGradientKernel,
864 MPSNDArrayMultiaryBase,
865 MPSKernel,
866 NSObject
867 ))]
868 #[derive(Debug, PartialEq, Eq, Hash)]
869 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
870 pub struct MPSNDArrayUnaryGradientKernel;
871);
872
873#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
874extern_conformance!(
875 unsafe impl NSCoding for MPSNDArrayUnaryGradientKernel {}
876);
877
878#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
879extern_conformance!(
880 unsafe impl NSCopying for MPSNDArrayUnaryGradientKernel {}
881);
882
883#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
884unsafe impl CopyingHelper for MPSNDArrayUnaryGradientKernel {
885 type Result = Self;
886}
887
888#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
889extern_conformance!(
890 unsafe impl NSObjectProtocol for MPSNDArrayUnaryGradientKernel {}
891);
892
893#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
894extern_conformance!(
895 unsafe impl NSSecureCoding for MPSNDArrayUnaryGradientKernel {}
896);
897
898#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
899impl MPSNDArrayUnaryGradientKernel {
900 extern_methods!(
901 #[unsafe(method(initWithDevice:))]
902 #[unsafe(method_family = init)]
903 pub unsafe fn initWithDevice(
904 this: Allocated<Self>,
905 device: &ProtocolObject<dyn MTLDevice>,
906 ) -> Retained<Self>;
907
908 #[unsafe(method(initWithDevice:sourceCount:sourceGradientIndex:))]
909 #[unsafe(method_family = init)]
910 pub unsafe fn initWithDevice_sourceCount_sourceGradientIndex(
911 this: Allocated<Self>,
912 device: &ProtocolObject<dyn MTLDevice>,
913 count: NSUInteger,
914 source_gradient_index: NSUInteger,
915 ) -> Retained<Self>;
916
917 #[unsafe(method(initWithCoder:device:))]
921 #[unsafe(method_family = init)]
922 pub unsafe fn initWithCoder_device(
923 this: Allocated<Self>,
924 coder: &NSCoder,
925 device: &ProtocolObject<dyn MTLDevice>,
926 ) -> Retained<Self>;
927
928 #[cfg(feature = "MPSState")]
929 #[unsafe(method(encodeToCommandBuffer:sourceArray:sourceGradient:gradientState:))]
930 #[unsafe(method_family = none)]
931 pub unsafe fn encodeToCommandBuffer_sourceArray_sourceGradient_gradientState(
932 &self,
933 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
934 source_array: &MPSNDArray,
935 gradient: &MPSNDArray,
936 state: &MPSState,
937 ) -> Retained<MPSNDArray>;
938
939 #[cfg(feature = "MPSState")]
940 #[unsafe(method(encodeToCommandBuffer:sourceArray:sourceGradient:gradientState:destinationArray:))]
941 #[unsafe(method_family = none)]
942 pub unsafe fn encodeToCommandBuffer_sourceArray_sourceGradient_gradientState_destinationArray(
943 &self,
944 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
945 source_array: &MPSNDArray,
946 gradient: &MPSNDArray,
947 state: &MPSState,
948 destination: &MPSNDArray,
949 );
950 );
951}
952
953#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
955impl MPSNDArrayUnaryGradientKernel {
956 extern_methods!(
957 #[unsafe(method(initWithDevice:sourceCount:))]
958 #[unsafe(method_family = init)]
959 pub unsafe fn initWithDevice_sourceCount(
960 this: Allocated<Self>,
961 device: &ProtocolObject<dyn MTLDevice>,
962 count: NSUInteger,
963 ) -> Retained<Self>;
964 );
965}
966
967#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
969impl MPSNDArrayUnaryGradientKernel {
970 extern_methods!(
971 #[unsafe(method(initWithCoder:))]
984 #[unsafe(method_family = init)]
985 pub unsafe fn initWithCoder(
986 this: Allocated<Self>,
987 a_decoder: &NSCoder,
988 ) -> Option<Retained<Self>>;
989 );
990}
991
992#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
994impl MPSNDArrayUnaryGradientKernel {
995 extern_methods!(
996 #[unsafe(method(init))]
997 #[unsafe(method_family = init)]
998 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
999
1000 #[unsafe(method(new))]
1001 #[unsafe(method_family = new)]
1002 pub unsafe fn new() -> Retained<Self>;
1003 );
1004}
1005
1006extern_class!(
1007 #[unsafe(super(MPSNDArrayMultiaryKernel, MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
1009 #[derive(Debug, PartialEq, Eq, Hash)]
1010 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1011 pub struct MPSNDArrayBinaryKernel;
1012);
1013
1014#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1015extern_conformance!(
1016 unsafe impl NSCoding for MPSNDArrayBinaryKernel {}
1017);
1018
1019#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1020extern_conformance!(
1021 unsafe impl NSCopying for MPSNDArrayBinaryKernel {}
1022);
1023
1024#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1025unsafe impl CopyingHelper for MPSNDArrayBinaryKernel {
1026 type Result = Self;
1027}
1028
1029#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1030extern_conformance!(
1031 unsafe impl NSObjectProtocol for MPSNDArrayBinaryKernel {}
1032);
1033
1034#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1035extern_conformance!(
1036 unsafe impl NSSecureCoding for MPSNDArrayBinaryKernel {}
1037);
1038
1039#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1040impl MPSNDArrayBinaryKernel {
1041 extern_methods!(
1042 #[cfg(feature = "MPSNDArrayTypes")]
1043 #[deprecated]
1050 #[unsafe(method(primaryOffsets))]
1051 #[unsafe(method_family = none)]
1052 pub unsafe fn primaryOffsets(&self) -> MPSNDArrayOffsets;
1053
1054 #[cfg(feature = "MPSCoreTypes")]
1055 #[deprecated]
1058 #[unsafe(method(primaryEdgeMode))]
1059 #[unsafe(method_family = none)]
1060 pub unsafe fn primaryEdgeMode(&self) -> MPSImageEdgeMode;
1061
1062 #[cfg(feature = "MPSNDArrayTypes")]
1063 #[deprecated]
1066 #[unsafe(method(primaryKernelSizes))]
1067 #[unsafe(method_family = none)]
1068 pub unsafe fn primaryKernelSizes(&self) -> MPSNDArraySizes;
1069
1070 #[cfg(feature = "MPSNDArrayTypes")]
1071 #[deprecated]
1076 #[unsafe(method(primaryStrides))]
1077 #[unsafe(method_family = none)]
1078 pub unsafe fn primaryStrides(&self) -> MPSNDArrayOffsets;
1079
1080 #[cfg(feature = "MPSNDArrayTypes")]
1081 #[deprecated]
1084 #[unsafe(method(primaryDilationRates))]
1085 #[unsafe(method_family = none)]
1086 pub unsafe fn primaryDilationRates(&self) -> MPSNDArraySizes;
1087
1088 #[cfg(feature = "MPSNDArrayTypes")]
1089 #[deprecated]
1096 #[unsafe(method(secondaryOffsets))]
1097 #[unsafe(method_family = none)]
1098 pub unsafe fn secondaryOffsets(&self) -> MPSNDArrayOffsets;
1099
1100 #[cfg(feature = "MPSCoreTypes")]
1101 #[deprecated]
1104 #[unsafe(method(secondaryEdgeMode))]
1105 #[unsafe(method_family = none)]
1106 pub unsafe fn secondaryEdgeMode(&self) -> MPSImageEdgeMode;
1107
1108 #[cfg(feature = "MPSNDArrayTypes")]
1109 #[deprecated]
1112 #[unsafe(method(secondaryKernelSizes))]
1113 #[unsafe(method_family = none)]
1114 pub unsafe fn secondaryKernelSizes(&self) -> MPSNDArraySizes;
1115
1116 #[cfg(feature = "MPSNDArrayTypes")]
1117 #[deprecated]
1122 #[unsafe(method(secondaryStrides))]
1123 #[unsafe(method_family = none)]
1124 pub unsafe fn secondaryStrides(&self) -> MPSNDArrayOffsets;
1125
1126 #[cfg(feature = "MPSNDArrayTypes")]
1127 #[deprecated]
1130 #[unsafe(method(secondaryDilationRates))]
1131 #[unsafe(method_family = none)]
1132 pub unsafe fn secondaryDilationRates(&self) -> MPSNDArraySizes;
1133
1134 #[unsafe(method(initWithDevice:))]
1135 #[unsafe(method_family = init)]
1136 pub unsafe fn initWithDevice(
1137 this: Allocated<Self>,
1138 device: &ProtocolObject<dyn MTLDevice>,
1139 ) -> Retained<Self>;
1140
1141 #[unsafe(method(initWithDevice:sourceCount:))]
1142 #[unsafe(method_family = init)]
1143 pub unsafe fn initWithDevice_sourceCount(
1144 this: Allocated<Self>,
1145 device: &ProtocolObject<dyn MTLDevice>,
1146 count: NSUInteger,
1147 ) -> Retained<Self>;
1148
1149 #[unsafe(method(initWithCoder:device:))]
1153 #[unsafe(method_family = init)]
1154 pub unsafe fn initWithCoder_device(
1155 this: Allocated<Self>,
1156 coder: &NSCoder,
1157 device: &ProtocolObject<dyn MTLDevice>,
1158 ) -> Retained<Self>;
1159
1160 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:))]
1171 #[unsafe(method_family = none)]
1172 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray(
1173 &self,
1174 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1175 primary_source_array: &MPSNDArray,
1176 secondary_source_array: &MPSNDArray,
1177 ) -> Retained<MPSNDArray>;
1178
1179 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:destinationArray:))]
1189 #[unsafe(method_family = none)]
1190 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_destinationArray(
1191 &self,
1192 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1193 primary_source_array: &MPSNDArray,
1194 secondary_source_array: &MPSNDArray,
1195 destination: &MPSNDArray,
1196 );
1197
1198 #[cfg(feature = "MPSState")]
1199 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:resultState:outputStateIsTemporary:))]
1214 #[unsafe(method_family = none)]
1215 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_resultState_outputStateIsTemporary(
1216 &self,
1217 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1218 primary_source_array: &MPSNDArray,
1219 secondary_source_array: &MPSNDArray,
1220 out_gradient_state: Option<&mut Option<Retained<MPSState>>>,
1221 output_state_is_temporary: bool,
1222 ) -> Retained<MPSNDArray>;
1223
1224 #[cfg(feature = "MPSState")]
1225 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:resultState:destinationArray:))]
1238 #[unsafe(method_family = none)]
1239 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_resultState_destinationArray(
1240 &self,
1241 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1242 primary_source_array: &MPSNDArray,
1243 secondary_source_array: &MPSNDArray,
1244 out_gradient_state: Option<&MPSState>,
1245 destination: &MPSNDArray,
1246 );
1247 );
1248}
1249
1250#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1252impl MPSNDArrayBinaryKernel {
1253 extern_methods!(
1254 #[unsafe(method(initWithCoder:))]
1267 #[unsafe(method_family = init)]
1268 pub unsafe fn initWithCoder(
1269 this: Allocated<Self>,
1270 a_decoder: &NSCoder,
1271 ) -> Option<Retained<Self>>;
1272 );
1273}
1274
1275#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1277impl MPSNDArrayBinaryKernel {
1278 extern_methods!(
1279 #[unsafe(method(init))]
1280 #[unsafe(method_family = init)]
1281 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1282
1283 #[unsafe(method(new))]
1284 #[unsafe(method_family = new)]
1285 pub unsafe fn new() -> Retained<Self>;
1286 );
1287}
1288
1289extern_class!(
1290 #[unsafe(super(
1294 MPSNDArrayMultiaryGradientKernel,
1295 MPSNDArrayMultiaryBase,
1296 MPSKernel,
1297 NSObject
1298 ))]
1299 #[derive(Debug, PartialEq, Eq, Hash)]
1300 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1301 pub struct MPSNDArrayBinaryPrimaryGradientKernel;
1302);
1303
1304#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1305extern_conformance!(
1306 unsafe impl NSCoding for MPSNDArrayBinaryPrimaryGradientKernel {}
1307);
1308
1309#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1310extern_conformance!(
1311 unsafe impl NSCopying for MPSNDArrayBinaryPrimaryGradientKernel {}
1312);
1313
1314#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1315unsafe impl CopyingHelper for MPSNDArrayBinaryPrimaryGradientKernel {
1316 type Result = Self;
1317}
1318
1319#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1320extern_conformance!(
1321 unsafe impl NSObjectProtocol for MPSNDArrayBinaryPrimaryGradientKernel {}
1322);
1323
1324#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1325extern_conformance!(
1326 unsafe impl NSSecureCoding for MPSNDArrayBinaryPrimaryGradientKernel {}
1327);
1328
1329#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1330impl MPSNDArrayBinaryPrimaryGradientKernel {
1331 extern_methods!(
1332 #[unsafe(method(initWithDevice:sourceCount:sourceGradientIndex:))]
1333 #[unsafe(method_family = init)]
1334 pub unsafe fn initWithDevice_sourceCount_sourceGradientIndex(
1335 this: Allocated<Self>,
1336 device: &ProtocolObject<dyn MTLDevice>,
1337 count: NSUInteger,
1338 source_gradient_index: NSUInteger,
1339 ) -> Retained<Self>;
1340
1341 #[unsafe(method(initWithDevice:))]
1342 #[unsafe(method_family = init)]
1343 pub unsafe fn initWithDevice(
1344 this: Allocated<Self>,
1345 device: &ProtocolObject<dyn MTLDevice>,
1346 ) -> Retained<Self>;
1347
1348 #[unsafe(method(initWithCoder:device:))]
1352 #[unsafe(method_family = init)]
1353 pub unsafe fn initWithCoder_device(
1354 this: Allocated<Self>,
1355 coder: &NSCoder,
1356 device: &ProtocolObject<dyn MTLDevice>,
1357 ) -> Retained<Self>;
1358
1359 #[cfg(feature = "MPSState")]
1360 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:))]
1361 #[unsafe(method_family = none)]
1362 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_sourceGradient_gradientState(
1363 &self,
1364 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1365 primary_source_array: &MPSNDArray,
1366 secondary_source_array: &MPSNDArray,
1367 gradient: &MPSNDArray,
1368 state: &MPSState,
1369 ) -> Retained<MPSNDArray>;
1370
1371 #[cfg(feature = "MPSState")]
1372 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:destinationArray:))]
1373 #[unsafe(method_family = none)]
1374 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_sourceGradient_gradientState_destinationArray(
1375 &self,
1376 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1377 primary_source_array: &MPSNDArray,
1378 secondary_source_array: &MPSNDArray,
1379 gradient: &MPSNDArray,
1380 state: &MPSState,
1381 destination: &MPSNDArray,
1382 );
1383 );
1384}
1385
1386#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1388impl MPSNDArrayBinaryPrimaryGradientKernel {
1389 extern_methods!(
1390 #[unsafe(method(initWithDevice:sourceCount:))]
1391 #[unsafe(method_family = init)]
1392 pub unsafe fn initWithDevice_sourceCount(
1393 this: Allocated<Self>,
1394 device: &ProtocolObject<dyn MTLDevice>,
1395 count: NSUInteger,
1396 ) -> Retained<Self>;
1397 );
1398}
1399
1400#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1402impl MPSNDArrayBinaryPrimaryGradientKernel {
1403 extern_methods!(
1404 #[unsafe(method(initWithCoder:))]
1417 #[unsafe(method_family = init)]
1418 pub unsafe fn initWithCoder(
1419 this: Allocated<Self>,
1420 a_decoder: &NSCoder,
1421 ) -> Option<Retained<Self>>;
1422 );
1423}
1424
1425#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1427impl MPSNDArrayBinaryPrimaryGradientKernel {
1428 extern_methods!(
1429 #[unsafe(method(init))]
1430 #[unsafe(method_family = init)]
1431 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1432
1433 #[unsafe(method(new))]
1434 #[unsafe(method_family = new)]
1435 pub unsafe fn new() -> Retained<Self>;
1436 );
1437}
1438
1439extern_class!(
1440 #[unsafe(super(
1444 MPSNDArrayMultiaryGradientKernel,
1445 MPSNDArrayMultiaryBase,
1446 MPSKernel,
1447 NSObject
1448 ))]
1449 #[derive(Debug, PartialEq, Eq, Hash)]
1450 #[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1451 pub struct MPSNDArrayBinarySecondaryGradientKernel;
1452);
1453
1454#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1455extern_conformance!(
1456 unsafe impl NSCoding for MPSNDArrayBinarySecondaryGradientKernel {}
1457);
1458
1459#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1460extern_conformance!(
1461 unsafe impl NSCopying for MPSNDArrayBinarySecondaryGradientKernel {}
1462);
1463
1464#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1465unsafe impl CopyingHelper for MPSNDArrayBinarySecondaryGradientKernel {
1466 type Result = Self;
1467}
1468
1469#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1470extern_conformance!(
1471 unsafe impl NSObjectProtocol for MPSNDArrayBinarySecondaryGradientKernel {}
1472);
1473
1474#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1475extern_conformance!(
1476 unsafe impl NSSecureCoding for MPSNDArrayBinarySecondaryGradientKernel {}
1477);
1478
1479#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1480impl MPSNDArrayBinarySecondaryGradientKernel {
1481 extern_methods!(
1482 #[unsafe(method(initWithDevice:sourceCount:sourceGradientIndex:))]
1483 #[unsafe(method_family = init)]
1484 pub unsafe fn initWithDevice_sourceCount_sourceGradientIndex(
1485 this: Allocated<Self>,
1486 device: &ProtocolObject<dyn MTLDevice>,
1487 count: NSUInteger,
1488 source_gradient_index: NSUInteger,
1489 ) -> Retained<Self>;
1490
1491 #[unsafe(method(initWithDevice:))]
1492 #[unsafe(method_family = init)]
1493 pub unsafe fn initWithDevice(
1494 this: Allocated<Self>,
1495 device: &ProtocolObject<dyn MTLDevice>,
1496 ) -> Retained<Self>;
1497
1498 #[unsafe(method(initWithCoder:device:))]
1502 #[unsafe(method_family = init)]
1503 pub unsafe fn initWithCoder_device(
1504 this: Allocated<Self>,
1505 coder: &NSCoder,
1506 device: &ProtocolObject<dyn MTLDevice>,
1507 ) -> Retained<Self>;
1508
1509 #[cfg(feature = "MPSState")]
1510 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:))]
1511 #[unsafe(method_family = none)]
1512 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_sourceGradient_gradientState(
1513 &self,
1514 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1515 primary_source_array: &MPSNDArray,
1516 secondary_source_array: &MPSNDArray,
1517 gradient: &MPSNDArray,
1518 state: &MPSState,
1519 ) -> Retained<MPSNDArray>;
1520
1521 #[cfg(feature = "MPSState")]
1522 #[unsafe(method(encodeToCommandBuffer:primarySourceArray:secondarySourceArray:sourceGradient:gradientState:destinationArray:))]
1523 #[unsafe(method_family = none)]
1524 pub unsafe fn encodeToCommandBuffer_primarySourceArray_secondarySourceArray_sourceGradient_gradientState_destinationArray(
1525 &self,
1526 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
1527 primary_source_array: &MPSNDArray,
1528 secondary_source_array: &MPSNDArray,
1529 gradient: &MPSNDArray,
1530 state: &MPSState,
1531 destination: &MPSNDArray,
1532 );
1533 );
1534}
1535
1536#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1538impl MPSNDArrayBinarySecondaryGradientKernel {
1539 extern_methods!(
1540 #[unsafe(method(initWithDevice:sourceCount:))]
1541 #[unsafe(method_family = init)]
1542 pub unsafe fn initWithDevice_sourceCount(
1543 this: Allocated<Self>,
1544 device: &ProtocolObject<dyn MTLDevice>,
1545 count: NSUInteger,
1546 ) -> Retained<Self>;
1547 );
1548}
1549
1550#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1552impl MPSNDArrayBinarySecondaryGradientKernel {
1553 extern_methods!(
1554 #[unsafe(method(initWithCoder:))]
1567 #[unsafe(method_family = init)]
1568 pub unsafe fn initWithCoder(
1569 this: Allocated<Self>,
1570 a_decoder: &NSCoder,
1571 ) -> Option<Retained<Self>>;
1572 );
1573}
1574
1575#[cfg(all(feature = "MPSCore", feature = "MPSKernel"))]
1577impl MPSNDArrayBinarySecondaryGradientKernel {
1578 extern_methods!(
1579 #[unsafe(method(init))]
1580 #[unsafe(method_family = init)]
1581 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1582
1583 #[unsafe(method(new))]
1584 #[unsafe(method_family = new)]
1585 pub unsafe fn new() -> Retained<Self>;
1586 );
1587}