objc2_metal_performance_shaders/generated/MPSNDArray/
MPSNDArrayIdentity.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6use objc2_metal::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(
17 MPSNDArrayUnaryKernel,
18 MPSNDArrayMultiaryKernel,
19 MPSNDArrayMultiaryBase,
20 MPSKernel,
21 NSObject
22 ))]
23 #[derive(Debug, PartialEq, Eq, Hash)]
24 #[cfg(all(
25 feature = "MPSCore",
26 feature = "MPSKernel",
27 feature = "MPSNDArrayKernel"
28 ))]
29 pub struct MPSNDArrayIdentity;
30);
31
32#[cfg(all(
33 feature = "MPSCore",
34 feature = "MPSKernel",
35 feature = "MPSNDArrayKernel"
36))]
37extern_conformance!(
38 unsafe impl NSCoding for MPSNDArrayIdentity {}
39);
40
41#[cfg(all(
42 feature = "MPSCore",
43 feature = "MPSKernel",
44 feature = "MPSNDArrayKernel"
45))]
46extern_conformance!(
47 unsafe impl NSCopying for MPSNDArrayIdentity {}
48);
49
50#[cfg(all(
51 feature = "MPSCore",
52 feature = "MPSKernel",
53 feature = "MPSNDArrayKernel"
54))]
55unsafe impl CopyingHelper for MPSNDArrayIdentity {
56 type Result = Self;
57}
58
59#[cfg(all(
60 feature = "MPSCore",
61 feature = "MPSKernel",
62 feature = "MPSNDArrayKernel"
63))]
64extern_conformance!(
65 unsafe impl NSObjectProtocol for MPSNDArrayIdentity {}
66);
67
68#[cfg(all(
69 feature = "MPSCore",
70 feature = "MPSKernel",
71 feature = "MPSNDArrayKernel"
72))]
73extern_conformance!(
74 unsafe impl NSSecureCoding for MPSNDArrayIdentity {}
75);
76
77#[cfg(all(
78 feature = "MPSCore",
79 feature = "MPSKernel",
80 feature = "MPSNDArrayKernel"
81))]
82impl MPSNDArrayIdentity {
83 extern_methods!(
84 #[unsafe(method(initWithDevice:))]
85 #[unsafe(method_family = init)]
86 pub unsafe fn initWithDevice(
87 this: Allocated<Self>,
88 device: &ProtocolObject<dyn MTLDevice>,
89 ) -> Retained<Self>;
90
91 #[cfg(feature = "MPSCoreTypes")]
92 #[unsafe(method(reshapeWithCommandBuffer:sourceArray:shape:destinationArray:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn reshapeWithCommandBuffer_sourceArray_shape_destinationArray(
109 &self,
110 cmd_buf: Option<&ProtocolObject<dyn MTLCommandBuffer>>,
111 source_array: &MPSNDArray,
112 shape: &MPSShape,
113 destination_array: Option<&MPSNDArray>,
114 ) -> Option<Retained<MPSNDArray>>;
115
116 #[unsafe(method(reshapeWithCommandBuffer:sourceArray:dimensionCount:dimensionSizes:destinationArray:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn reshapeWithCommandBuffer_sourceArray_dimensionCount_dimensionSizes_destinationArray(
122 &self,
123 cmd_buf: Option<&ProtocolObject<dyn MTLCommandBuffer>>,
124 source_array: &MPSNDArray,
125 number_of_dimensions: NSUInteger,
126 dimension_sizes: NonNull<NSUInteger>,
127 destination_array: Option<&MPSNDArray>,
128 ) -> Option<Retained<MPSNDArray>>;
129
130 #[cfg(feature = "MPSCoreTypes")]
131 #[unsafe(method(reshapeWithCommandEncoder:commandBuffer:sourceArray:shape:destinationArray:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn reshapeWithCommandEncoder_commandBuffer_sourceArray_shape_destinationArray(
134 &self,
135 encoder: Option<&ProtocolObject<dyn MTLComputeCommandEncoder>>,
136 cmd_buf: Option<&ProtocolObject<dyn MTLCommandBuffer>>,
137 source_array: &MPSNDArray,
138 shape: &MPSShape,
139 destination_array: Option<&MPSNDArray>,
140 ) -> Option<Retained<MPSNDArray>>;
141
142 #[unsafe(method(reshapeWithCommandEncoder:commandBuffer:sourceArray:dimensionCount:dimensionSizes:destinationArray:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn reshapeWithCommandEncoder_commandBuffer_sourceArray_dimensionCount_dimensionSizes_destinationArray(
148 &self,
149 encoder: Option<&ProtocolObject<dyn MTLComputeCommandEncoder>>,
150 cmd_buf: Option<&ProtocolObject<dyn MTLCommandBuffer>>,
151 source_array: &MPSNDArray,
152 number_of_dimensions: NSUInteger,
153 dimension_sizes: NonNull<NSUInteger>,
154 destination_array: Option<&MPSNDArray>,
155 ) -> Option<Retained<MPSNDArray>>;
156 );
157}
158
159#[cfg(all(
161 feature = "MPSCore",
162 feature = "MPSKernel",
163 feature = "MPSNDArrayKernel"
164))]
165impl MPSNDArrayIdentity {
166 extern_methods!(
167 #[unsafe(method(initWithDevice:sourceCount:))]
168 #[unsafe(method_family = init)]
169 pub unsafe fn initWithDevice_sourceCount(
170 this: Allocated<Self>,
171 device: &ProtocolObject<dyn MTLDevice>,
172 count: NSUInteger,
173 ) -> Retained<Self>;
174
175 #[unsafe(method(initWithCoder:device:))]
179 #[unsafe(method_family = init)]
180 pub unsafe fn initWithCoder_device(
181 this: Allocated<Self>,
182 coder: &NSCoder,
183 device: &ProtocolObject<dyn MTLDevice>,
184 ) -> Retained<Self>;
185 );
186}
187
188#[cfg(all(
190 feature = "MPSCore",
191 feature = "MPSKernel",
192 feature = "MPSNDArrayKernel"
193))]
194impl MPSNDArrayIdentity {
195 extern_methods!(
196 #[unsafe(method(initWithCoder:))]
209 #[unsafe(method_family = init)]
210 pub unsafe fn initWithCoder(
211 this: Allocated<Self>,
212 a_decoder: &NSCoder,
213 ) -> Option<Retained<Self>>;
214 );
215}
216
217#[cfg(all(
219 feature = "MPSCore",
220 feature = "MPSKernel",
221 feature = "MPSNDArrayKernel"
222))]
223impl MPSNDArrayIdentity {
224 extern_methods!(
225 #[unsafe(method(init))]
226 #[unsafe(method_family = init)]
227 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
228
229 #[unsafe(method(new))]
230 #[unsafe(method_family = new)]
231 pub unsafe fn new() -> Retained<Self>;
232 );
233}