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(
42 MPSNDArrayMatrixMultiplication,
43 MPSNDArrayMultiaryKernel,
44 MPSNDArrayMultiaryBase,
45 MPSKernel,
46 NSObject
47 ))]
48 #[derive(Debug, PartialEq, Eq, Hash)]
49 #[cfg(all(
50 feature = "MPSCore",
51 feature = "MPSKernel",
52 feature = "MPSNDArrayKernel",
53 feature = "MPSNDArrayMatrixMultiplication"
54 ))]
55 pub struct MPSNDArrayQuantizedMatrixMultiplication;
56);
57
58#[cfg(all(
59 feature = "MPSCore",
60 feature = "MPSKernel",
61 feature = "MPSNDArrayKernel",
62 feature = "MPSNDArrayMatrixMultiplication"
63))]
64extern_conformance!(
65 unsafe impl NSCoding for MPSNDArrayQuantizedMatrixMultiplication {}
66);
67
68#[cfg(all(
69 feature = "MPSCore",
70 feature = "MPSKernel",
71 feature = "MPSNDArrayKernel",
72 feature = "MPSNDArrayMatrixMultiplication"
73))]
74extern_conformance!(
75 unsafe impl NSCopying for MPSNDArrayQuantizedMatrixMultiplication {}
76);
77
78#[cfg(all(
79 feature = "MPSCore",
80 feature = "MPSKernel",
81 feature = "MPSNDArrayKernel",
82 feature = "MPSNDArrayMatrixMultiplication"
83))]
84unsafe impl CopyingHelper for MPSNDArrayQuantizedMatrixMultiplication {
85 type Result = Self;
86}
87
88#[cfg(all(
89 feature = "MPSCore",
90 feature = "MPSKernel",
91 feature = "MPSNDArrayKernel",
92 feature = "MPSNDArrayMatrixMultiplication"
93))]
94extern_conformance!(
95 unsafe impl NSObjectProtocol for MPSNDArrayQuantizedMatrixMultiplication {}
96);
97
98#[cfg(all(
99 feature = "MPSCore",
100 feature = "MPSKernel",
101 feature = "MPSNDArrayKernel",
102 feature = "MPSNDArrayMatrixMultiplication"
103))]
104extern_conformance!(
105 unsafe impl NSSecureCoding for MPSNDArrayQuantizedMatrixMultiplication {}
106);
107
108#[cfg(all(
109 feature = "MPSCore",
110 feature = "MPSKernel",
111 feature = "MPSNDArrayKernel",
112 feature = "MPSNDArrayMatrixMultiplication"
113))]
114impl MPSNDArrayQuantizedMatrixMultiplication {
115 extern_methods!(
116 #[unsafe(method(initWithDevice:sourceCount:))]
117 #[unsafe(method_family = init)]
118 pub unsafe fn initWithDevice_sourceCount(
119 this: Allocated<Self>,
120 device: &ProtocolObject<dyn MTLDevice>,
121 source_count: NSUInteger,
122 ) -> Retained<Self>;
123
124 #[cfg(feature = "MPSNDArrayQuantization")]
125 #[unsafe(method(initWithDevice:leftQuantizationDescriptor:rightQuantizationDescriptor:))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn initWithDevice_leftQuantizationDescriptor_rightQuantizationDescriptor(
135 this: Allocated<Self>,
136 device: &ProtocolObject<dyn MTLDevice>,
137 left_quantization_descriptor: Option<&MPSNDArrayQuantizationDescriptor>,
138 right_quantization_descriptor: Option<&MPSNDArrayQuantizationDescriptor>,
139 ) -> Retained<Self>;
140 );
141}
142
143#[cfg(all(
145 feature = "MPSCore",
146 feature = "MPSKernel",
147 feature = "MPSNDArrayKernel",
148 feature = "MPSNDArrayMatrixMultiplication"
149))]
150impl MPSNDArrayQuantizedMatrixMultiplication {
151 extern_methods!(
152 #[unsafe(method(initWithCoder:device:))]
156 #[unsafe(method_family = init)]
157 pub unsafe fn initWithCoder_device(
158 this: Allocated<Self>,
159 coder: &NSCoder,
160 device: &ProtocolObject<dyn MTLDevice>,
161 ) -> Retained<Self>;
162 );
163}
164
165#[cfg(all(
167 feature = "MPSCore",
168 feature = "MPSKernel",
169 feature = "MPSNDArrayKernel",
170 feature = "MPSNDArrayMatrixMultiplication"
171))]
172impl MPSNDArrayQuantizedMatrixMultiplication {
173 extern_methods!(
174 #[unsafe(method(initWithDevice:))]
175 #[unsafe(method_family = init)]
176 pub unsafe fn initWithDevice(
177 this: Allocated<Self>,
178 device: &ProtocolObject<dyn MTLDevice>,
179 ) -> Retained<Self>;
180 );
181}
182
183#[cfg(all(
185 feature = "MPSCore",
186 feature = "MPSKernel",
187 feature = "MPSNDArrayKernel",
188 feature = "MPSNDArrayMatrixMultiplication"
189))]
190impl MPSNDArrayQuantizedMatrixMultiplication {
191 extern_methods!(
192 #[unsafe(method(initWithCoder:))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn initWithCoder(
207 this: Allocated<Self>,
208 a_decoder: &NSCoder,
209 ) -> Option<Retained<Self>>;
210 );
211}
212
213#[cfg(all(
215 feature = "MPSCore",
216 feature = "MPSKernel",
217 feature = "MPSNDArrayKernel",
218 feature = "MPSNDArrayMatrixMultiplication"
219))]
220impl MPSNDArrayQuantizedMatrixMultiplication {
221 extern_methods!(
222 #[unsafe(method(init))]
223 #[unsafe(method_family = init)]
224 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
225
226 #[unsafe(method(new))]
227 #[unsafe(method_family = new)]
228 pub unsafe fn new() -> Retained<Self>;
229 );
230}
231
232extern_class!(
233 #[unsafe(super(MPSNDArrayMultiaryKernel, MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
241 #[derive(Debug, PartialEq, Eq, Hash)]
242 #[cfg(all(
243 feature = "MPSCore",
244 feature = "MPSKernel",
245 feature = "MPSNDArrayKernel"
246 ))]
247 pub struct MPSNDArrayLUTDequantize;
248);
249
250#[cfg(all(
251 feature = "MPSCore",
252 feature = "MPSKernel",
253 feature = "MPSNDArrayKernel"
254))]
255extern_conformance!(
256 unsafe impl NSCoding for MPSNDArrayLUTDequantize {}
257);
258
259#[cfg(all(
260 feature = "MPSCore",
261 feature = "MPSKernel",
262 feature = "MPSNDArrayKernel"
263))]
264extern_conformance!(
265 unsafe impl NSCopying for MPSNDArrayLUTDequantize {}
266);
267
268#[cfg(all(
269 feature = "MPSCore",
270 feature = "MPSKernel",
271 feature = "MPSNDArrayKernel"
272))]
273unsafe impl CopyingHelper for MPSNDArrayLUTDequantize {
274 type Result = Self;
275}
276
277#[cfg(all(
278 feature = "MPSCore",
279 feature = "MPSKernel",
280 feature = "MPSNDArrayKernel"
281))]
282extern_conformance!(
283 unsafe impl NSObjectProtocol for MPSNDArrayLUTDequantize {}
284);
285
286#[cfg(all(
287 feature = "MPSCore",
288 feature = "MPSKernel",
289 feature = "MPSNDArrayKernel"
290))]
291extern_conformance!(
292 unsafe impl NSSecureCoding for MPSNDArrayLUTDequantize {}
293);
294
295#[cfg(all(
296 feature = "MPSCore",
297 feature = "MPSKernel",
298 feature = "MPSNDArrayKernel"
299))]
300impl MPSNDArrayLUTDequantize {
301 extern_methods!(
302 #[unsafe(method(initWithDevice:))]
303 #[unsafe(method_family = init)]
304 pub unsafe fn initWithDevice(
305 this: Allocated<Self>,
306 device: &ProtocolObject<dyn MTLDevice>,
307 ) -> Retained<Self>;
308
309 #[unsafe(method(initWithDevice:sourceCount:))]
310 #[unsafe(method_family = init)]
311 pub unsafe fn initWithDevice_sourceCount(
312 this: Allocated<Self>,
313 device: &ProtocolObject<dyn MTLDevice>,
314 source_count: NSUInteger,
315 ) -> Retained<Self>;
316 );
317}
318
319#[cfg(all(
321 feature = "MPSCore",
322 feature = "MPSKernel",
323 feature = "MPSNDArrayKernel"
324))]
325impl MPSNDArrayLUTDequantize {
326 extern_methods!(
327 #[unsafe(method(initWithCoder:device:))]
331 #[unsafe(method_family = init)]
332 pub unsafe fn initWithCoder_device(
333 this: Allocated<Self>,
334 coder: &NSCoder,
335 device: &ProtocolObject<dyn MTLDevice>,
336 ) -> Retained<Self>;
337 );
338}
339
340#[cfg(all(
342 feature = "MPSCore",
343 feature = "MPSKernel",
344 feature = "MPSNDArrayKernel"
345))]
346impl MPSNDArrayLUTDequantize {
347 extern_methods!(
348 #[unsafe(method(initWithCoder:))]
361 #[unsafe(method_family = init)]
362 pub unsafe fn initWithCoder(
363 this: Allocated<Self>,
364 a_decoder: &NSCoder,
365 ) -> Option<Retained<Self>>;
366 );
367}
368
369#[cfg(all(
371 feature = "MPSCore",
372 feature = "MPSKernel",
373 feature = "MPSNDArrayKernel"
374))]
375impl MPSNDArrayLUTDequantize {
376 extern_methods!(
377 #[unsafe(method(init))]
378 #[unsafe(method_family = init)]
379 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
380
381 #[unsafe(method(new))]
382 #[unsafe(method_family = new)]
383 pub unsafe fn new() -> Retained<Self>;
384 );
385}
386
387extern_class!(
388 #[unsafe(super(MPSNDArrayMultiaryKernel, MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
396 #[derive(Debug, PartialEq, Eq, Hash)]
397 #[cfg(all(
398 feature = "MPSCore",
399 feature = "MPSKernel",
400 feature = "MPSNDArrayKernel"
401 ))]
402 pub struct MPSNDArrayVectorLUTDequantize;
403);
404
405#[cfg(all(
406 feature = "MPSCore",
407 feature = "MPSKernel",
408 feature = "MPSNDArrayKernel"
409))]
410extern_conformance!(
411 unsafe impl NSCoding for MPSNDArrayVectorLUTDequantize {}
412);
413
414#[cfg(all(
415 feature = "MPSCore",
416 feature = "MPSKernel",
417 feature = "MPSNDArrayKernel"
418))]
419extern_conformance!(
420 unsafe impl NSCopying for MPSNDArrayVectorLUTDequantize {}
421);
422
423#[cfg(all(
424 feature = "MPSCore",
425 feature = "MPSKernel",
426 feature = "MPSNDArrayKernel"
427))]
428unsafe impl CopyingHelper for MPSNDArrayVectorLUTDequantize {
429 type Result = Self;
430}
431
432#[cfg(all(
433 feature = "MPSCore",
434 feature = "MPSKernel",
435 feature = "MPSNDArrayKernel"
436))]
437extern_conformance!(
438 unsafe impl NSObjectProtocol for MPSNDArrayVectorLUTDequantize {}
439);
440
441#[cfg(all(
442 feature = "MPSCore",
443 feature = "MPSKernel",
444 feature = "MPSNDArrayKernel"
445))]
446extern_conformance!(
447 unsafe impl NSSecureCoding for MPSNDArrayVectorLUTDequantize {}
448);
449
450#[cfg(all(
451 feature = "MPSCore",
452 feature = "MPSKernel",
453 feature = "MPSNDArrayKernel"
454))]
455impl MPSNDArrayVectorLUTDequantize {
456 extern_methods!(
457 #[unsafe(method(vectorAxis))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn vectorAxis(&self) -> NSUInteger;
461
462 #[unsafe(method(setVectorAxis:))]
464 #[unsafe(method_family = none)]
465 pub unsafe fn setVectorAxis(&self, vector_axis: NSUInteger);
466
467 #[unsafe(method(initWithDevice:axis:))]
475 #[unsafe(method_family = init)]
476 pub unsafe fn initWithDevice_axis(
477 this: Allocated<Self>,
478 device: &ProtocolObject<dyn MTLDevice>,
479 axis: NSUInteger,
480 ) -> Retained<Self>;
481
482 #[unsafe(method(initWithDevice:sourceCount:))]
483 #[unsafe(method_family = init)]
484 pub unsafe fn initWithDevice_sourceCount(
485 this: Allocated<Self>,
486 device: &ProtocolObject<dyn MTLDevice>,
487 source_count: NSUInteger,
488 ) -> Retained<Self>;
489 );
490}
491
492#[cfg(all(
494 feature = "MPSCore",
495 feature = "MPSKernel",
496 feature = "MPSNDArrayKernel"
497))]
498impl MPSNDArrayVectorLUTDequantize {
499 extern_methods!(
500 #[unsafe(method(initWithCoder:device:))]
504 #[unsafe(method_family = init)]
505 pub unsafe fn initWithCoder_device(
506 this: Allocated<Self>,
507 coder: &NSCoder,
508 device: &ProtocolObject<dyn MTLDevice>,
509 ) -> Retained<Self>;
510 );
511}
512
513#[cfg(all(
515 feature = "MPSCore",
516 feature = "MPSKernel",
517 feature = "MPSNDArrayKernel"
518))]
519impl MPSNDArrayVectorLUTDequantize {
520 extern_methods!(
521 #[unsafe(method(initWithDevice:))]
522 #[unsafe(method_family = init)]
523 pub unsafe fn initWithDevice(
524 this: Allocated<Self>,
525 device: &ProtocolObject<dyn MTLDevice>,
526 ) -> Retained<Self>;
527 );
528}
529
530#[cfg(all(
532 feature = "MPSCore",
533 feature = "MPSKernel",
534 feature = "MPSNDArrayKernel"
535))]
536impl MPSNDArrayVectorLUTDequantize {
537 extern_methods!(
538 #[unsafe(method(initWithCoder:))]
551 #[unsafe(method_family = init)]
552 pub unsafe fn initWithCoder(
553 this: Allocated<Self>,
554 a_decoder: &NSCoder,
555 ) -> Option<Retained<Self>>;
556 );
557}
558
559#[cfg(all(
561 feature = "MPSCore",
562 feature = "MPSKernel",
563 feature = "MPSNDArrayKernel"
564))]
565impl MPSNDArrayVectorLUTDequantize {
566 extern_methods!(
567 #[unsafe(method(init))]
568 #[unsafe(method_family = init)]
569 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
570
571 #[unsafe(method(new))]
572 #[unsafe(method_family = new)]
573 pub unsafe fn new() -> Retained<Self>;
574 );
575}
576
577extern_class!(
578 #[unsafe(super(MPSNDArrayMultiaryKernel, MPSNDArrayMultiaryBase, MPSKernel, NSObject))]
586 #[derive(Debug, PartialEq, Eq, Hash)]
587 #[cfg(all(
588 feature = "MPSCore",
589 feature = "MPSKernel",
590 feature = "MPSNDArrayKernel"
591 ))]
592 pub struct MPSNDArrayAffineInt4Dequantize;
593);
594
595#[cfg(all(
596 feature = "MPSCore",
597 feature = "MPSKernel",
598 feature = "MPSNDArrayKernel"
599))]
600extern_conformance!(
601 unsafe impl NSCoding for MPSNDArrayAffineInt4Dequantize {}
602);
603
604#[cfg(all(
605 feature = "MPSCore",
606 feature = "MPSKernel",
607 feature = "MPSNDArrayKernel"
608))]
609extern_conformance!(
610 unsafe impl NSCopying for MPSNDArrayAffineInt4Dequantize {}
611);
612
613#[cfg(all(
614 feature = "MPSCore",
615 feature = "MPSKernel",
616 feature = "MPSNDArrayKernel"
617))]
618unsafe impl CopyingHelper for MPSNDArrayAffineInt4Dequantize {
619 type Result = Self;
620}
621
622#[cfg(all(
623 feature = "MPSCore",
624 feature = "MPSKernel",
625 feature = "MPSNDArrayKernel"
626))]
627extern_conformance!(
628 unsafe impl NSObjectProtocol for MPSNDArrayAffineInt4Dequantize {}
629);
630
631#[cfg(all(
632 feature = "MPSCore",
633 feature = "MPSKernel",
634 feature = "MPSNDArrayKernel"
635))]
636extern_conformance!(
637 unsafe impl NSSecureCoding for MPSNDArrayAffineInt4Dequantize {}
638);
639
640#[cfg(all(
641 feature = "MPSCore",
642 feature = "MPSKernel",
643 feature = "MPSNDArrayKernel"
644))]
645impl MPSNDArrayAffineInt4Dequantize {
646 extern_methods!(
647 #[unsafe(method(initWithDevice:))]
648 #[unsafe(method_family = init)]
649 pub unsafe fn initWithDevice(
650 this: Allocated<Self>,
651 device: &ProtocolObject<dyn MTLDevice>,
652 ) -> Retained<Self>;
653
654 #[cfg(feature = "MPSNDArrayQuantization")]
655 #[unsafe(method(initWithDevice:quantizationDescriptor:))]
663 #[unsafe(method_family = init)]
664 pub unsafe fn initWithDevice_quantizationDescriptor(
665 this: Allocated<Self>,
666 device: &ProtocolObject<dyn MTLDevice>,
667 quantization_descriptor: &MPSNDArrayAffineQuantizationDescriptor,
668 ) -> Retained<Self>;
669
670 #[unsafe(method(initWithDevice:sourceCount:))]
671 #[unsafe(method_family = init)]
672 pub unsafe fn initWithDevice_sourceCount(
673 this: Allocated<Self>,
674 device: &ProtocolObject<dyn MTLDevice>,
675 source_count: NSUInteger,
676 ) -> Retained<Self>;
677 );
678}
679
680#[cfg(all(
682 feature = "MPSCore",
683 feature = "MPSKernel",
684 feature = "MPSNDArrayKernel"
685))]
686impl MPSNDArrayAffineInt4Dequantize {
687 extern_methods!(
688 #[unsafe(method(initWithCoder:device:))]
692 #[unsafe(method_family = init)]
693 pub unsafe fn initWithCoder_device(
694 this: Allocated<Self>,
695 coder: &NSCoder,
696 device: &ProtocolObject<dyn MTLDevice>,
697 ) -> Retained<Self>;
698 );
699}
700
701#[cfg(all(
703 feature = "MPSCore",
704 feature = "MPSKernel",
705 feature = "MPSNDArrayKernel"
706))]
707impl MPSNDArrayAffineInt4Dequantize {
708 extern_methods!(
709 #[unsafe(method(initWithCoder:))]
722 #[unsafe(method_family = init)]
723 pub unsafe fn initWithCoder(
724 this: Allocated<Self>,
725 a_decoder: &NSCoder,
726 ) -> Option<Retained<Self>>;
727 );
728}
729
730#[cfg(all(
732 feature = "MPSCore",
733 feature = "MPSKernel",
734 feature = "MPSNDArrayKernel"
735))]
736impl MPSNDArrayAffineInt4Dequantize {
737 extern_methods!(
738 #[unsafe(method(init))]
739 #[unsafe(method_family = init)]
740 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
741
742 #[unsafe(method(new))]
743 #[unsafe(method_family = new)]
744 pub unsafe fn new() -> Retained<Self>;
745 );
746}