objc2_metal_performance_shaders/generated/MPSNeuralNetwork/
MPSNNGradientState.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6use objc2_metal::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(MPSState, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(all(feature = "MPSCore", feature = "MPSState"))]
20 pub struct MPSNNGradientState;
21);
22
23#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
24extern_conformance!(
25 unsafe impl NSObjectProtocol for MPSNNGradientState {}
26);
27
28#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
29impl MPSNNGradientState {
30 extern_methods!();
31}
32
33#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
35impl MPSNNGradientState {
36 extern_methods!(
37 #[unsafe(method(temporaryStateWithCommandBuffer:bufferSize:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn temporaryStateWithCommandBuffer_bufferSize(
45 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
46 buffer_size: usize,
47 ) -> Retained<Self>;
48
49 #[unsafe(method(temporaryStateWithCommandBuffer:textureDescriptor:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn temporaryStateWithCommandBuffer_textureDescriptor(
57 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
58 descriptor: &MTLTextureDescriptor,
59 ) -> Retained<Self>;
60
61 #[unsafe(method(temporaryStateWithCommandBuffer:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn temporaryStateWithCommandBuffer(
67 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
68 ) -> Retained<Self>;
69
70 #[unsafe(method(initWithDevice:bufferSize:))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn initWithDevice_bufferSize(
73 this: Allocated<Self>,
74 device: &ProtocolObject<dyn MTLDevice>,
75 buffer_size: usize,
76 ) -> Retained<Self>;
77
78 #[unsafe(method(initWithDevice:textureDescriptor:))]
79 #[unsafe(method_family = init)]
80 pub unsafe fn initWithDevice_textureDescriptor(
81 this: Allocated<Self>,
82 device: &ProtocolObject<dyn MTLDevice>,
83 descriptor: &MTLTextureDescriptor,
84 ) -> Retained<Self>;
85
86 #[unsafe(method(initWithResource:))]
95 #[unsafe(method_family = init)]
96 pub unsafe fn initWithResource(
97 this: Allocated<Self>,
98 resource: Option<&ProtocolObject<dyn MTLResource>>,
99 ) -> Retained<Self>;
100
101 #[unsafe(method(init))]
102 #[unsafe(method_family = init)]
103 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
104
105 #[unsafe(method(initWithDevice:resourceList:))]
112 #[unsafe(method_family = init)]
113 pub unsafe fn initWithDevice_resourceList(
114 this: Allocated<Self>,
115 device: &ProtocolObject<dyn MTLDevice>,
116 resource_list: &MPSStateResourceList,
117 ) -> Retained<Self>;
118
119 #[unsafe(method(temporaryStateWithCommandBuffer:resourceList:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn temporaryStateWithCommandBuffer_resourceList(
125 command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
126 resource_list: &MPSStateResourceList,
127 ) -> Retained<Self>;
128
129 #[unsafe(method(initWithResources:))]
141 #[unsafe(method_family = init)]
142 pub unsafe fn initWithResources(
143 this: Allocated<Self>,
144 resources: Option<&NSArray<ProtocolObject<dyn MTLResource>>>,
145 ) -> Retained<Self>;
146 );
147}
148
149#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
151impl MPSNNGradientState {
152 extern_methods!(
153 #[unsafe(method(new))]
154 #[unsafe(method_family = new)]
155 pub unsafe fn new() -> Retained<Self>;
156 );
157}
158
159#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
161pub type MPSNNGradientStateBatch = NSArray<MPSNNGradientState>;
162
163extern_class!(
164 #[unsafe(super(MPSState, NSObject))]
171 #[derive(Debug, PartialEq, Eq, Hash)]
172 #[cfg(all(feature = "MPSCore", feature = "MPSState"))]
173 pub struct MPSNNBinaryGradientState;
174);
175
176#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
177extern_conformance!(
178 unsafe impl NSObjectProtocol for MPSNNBinaryGradientState {}
179);
180
181#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
182impl MPSNNBinaryGradientState {
183 extern_methods!();
184}
185
186#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
188impl MPSNNBinaryGradientState {
189 extern_methods!(
190 #[unsafe(method(temporaryStateWithCommandBuffer:bufferSize:))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn temporaryStateWithCommandBuffer_bufferSize(
198 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
199 buffer_size: usize,
200 ) -> Retained<Self>;
201
202 #[unsafe(method(temporaryStateWithCommandBuffer:textureDescriptor:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn temporaryStateWithCommandBuffer_textureDescriptor(
210 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
211 descriptor: &MTLTextureDescriptor,
212 ) -> Retained<Self>;
213
214 #[unsafe(method(temporaryStateWithCommandBuffer:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn temporaryStateWithCommandBuffer(
220 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
221 ) -> Retained<Self>;
222
223 #[unsafe(method(initWithDevice:bufferSize:))]
224 #[unsafe(method_family = init)]
225 pub unsafe fn initWithDevice_bufferSize(
226 this: Allocated<Self>,
227 device: &ProtocolObject<dyn MTLDevice>,
228 buffer_size: usize,
229 ) -> Retained<Self>;
230
231 #[unsafe(method(initWithDevice:textureDescriptor:))]
232 #[unsafe(method_family = init)]
233 pub unsafe fn initWithDevice_textureDescriptor(
234 this: Allocated<Self>,
235 device: &ProtocolObject<dyn MTLDevice>,
236 descriptor: &MTLTextureDescriptor,
237 ) -> Retained<Self>;
238
239 #[unsafe(method(initWithResource:))]
248 #[unsafe(method_family = init)]
249 pub unsafe fn initWithResource(
250 this: Allocated<Self>,
251 resource: Option<&ProtocolObject<dyn MTLResource>>,
252 ) -> Retained<Self>;
253
254 #[unsafe(method(init))]
255 #[unsafe(method_family = init)]
256 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
257
258 #[unsafe(method(initWithDevice:resourceList:))]
265 #[unsafe(method_family = init)]
266 pub unsafe fn initWithDevice_resourceList(
267 this: Allocated<Self>,
268 device: &ProtocolObject<dyn MTLDevice>,
269 resource_list: &MPSStateResourceList,
270 ) -> Retained<Self>;
271
272 #[unsafe(method(temporaryStateWithCommandBuffer:resourceList:))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn temporaryStateWithCommandBuffer_resourceList(
278 command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
279 resource_list: &MPSStateResourceList,
280 ) -> Retained<Self>;
281
282 #[unsafe(method(initWithResources:))]
294 #[unsafe(method_family = init)]
295 pub unsafe fn initWithResources(
296 this: Allocated<Self>,
297 resources: Option<&NSArray<ProtocolObject<dyn MTLResource>>>,
298 ) -> Retained<Self>;
299 );
300}
301
302#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
304impl MPSNNBinaryGradientState {
305 extern_methods!(
306 #[unsafe(method(new))]
307 #[unsafe(method_family = new)]
308 pub unsafe fn new() -> Retained<Self>;
309 );
310}
311
312#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
314pub type MPSNNBinaryGradientStateBatch = NSArray<MPSNNBinaryGradientState>;
315
316extern_class!(
317 #[unsafe(super(MPSState, NSObject))]
319 #[derive(Debug, PartialEq, Eq, Hash)]
320 #[cfg(all(feature = "MPSCore", feature = "MPSState"))]
321 pub struct MPSNNMultiaryGradientState;
322);
323
324#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
325extern_conformance!(
326 unsafe impl NSObjectProtocol for MPSNNMultiaryGradientState {}
327);
328
329#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
330impl MPSNNMultiaryGradientState {
331 extern_methods!();
332}
333
334#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
336impl MPSNNMultiaryGradientState {
337 extern_methods!(
338 #[unsafe(method(temporaryStateWithCommandBuffer:bufferSize:))]
344 #[unsafe(method_family = none)]
345 pub unsafe fn temporaryStateWithCommandBuffer_bufferSize(
346 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
347 buffer_size: usize,
348 ) -> Retained<Self>;
349
350 #[unsafe(method(temporaryStateWithCommandBuffer:textureDescriptor:))]
356 #[unsafe(method_family = none)]
357 pub unsafe fn temporaryStateWithCommandBuffer_textureDescriptor(
358 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
359 descriptor: &MTLTextureDescriptor,
360 ) -> Retained<Self>;
361
362 #[unsafe(method(temporaryStateWithCommandBuffer:))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn temporaryStateWithCommandBuffer(
368 cmd_buf: &ProtocolObject<dyn MTLCommandBuffer>,
369 ) -> Retained<Self>;
370
371 #[unsafe(method(initWithDevice:bufferSize:))]
372 #[unsafe(method_family = init)]
373 pub unsafe fn initWithDevice_bufferSize(
374 this: Allocated<Self>,
375 device: &ProtocolObject<dyn MTLDevice>,
376 buffer_size: usize,
377 ) -> Retained<Self>;
378
379 #[unsafe(method(initWithDevice:textureDescriptor:))]
380 #[unsafe(method_family = init)]
381 pub unsafe fn initWithDevice_textureDescriptor(
382 this: Allocated<Self>,
383 device: &ProtocolObject<dyn MTLDevice>,
384 descriptor: &MTLTextureDescriptor,
385 ) -> Retained<Self>;
386
387 #[unsafe(method(initWithResource:))]
396 #[unsafe(method_family = init)]
397 pub unsafe fn initWithResource(
398 this: Allocated<Self>,
399 resource: Option<&ProtocolObject<dyn MTLResource>>,
400 ) -> Retained<Self>;
401
402 #[unsafe(method(init))]
403 #[unsafe(method_family = init)]
404 pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
405
406 #[unsafe(method(initWithDevice:resourceList:))]
413 #[unsafe(method_family = init)]
414 pub unsafe fn initWithDevice_resourceList(
415 this: Allocated<Self>,
416 device: &ProtocolObject<dyn MTLDevice>,
417 resource_list: &MPSStateResourceList,
418 ) -> Retained<Self>;
419
420 #[unsafe(method(temporaryStateWithCommandBuffer:resourceList:))]
424 #[unsafe(method_family = none)]
425 pub unsafe fn temporaryStateWithCommandBuffer_resourceList(
426 command_buffer: &ProtocolObject<dyn MTLCommandBuffer>,
427 resource_list: &MPSStateResourceList,
428 ) -> Retained<Self>;
429
430 #[unsafe(method(initWithResources:))]
442 #[unsafe(method_family = init)]
443 pub unsafe fn initWithResources(
444 this: Allocated<Self>,
445 resources: Option<&NSArray<ProtocolObject<dyn MTLResource>>>,
446 ) -> Retained<Self>;
447 );
448}
449
450#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
452impl MPSNNMultiaryGradientState {
453 extern_methods!(
454 #[unsafe(method(new))]
455 #[unsafe(method_family = new)]
456 pub unsafe fn new() -> Retained<Self>;
457 );
458}
459
460#[cfg(all(feature = "MPSCore", feature = "MPSState"))]
462pub type MPSNNMultiaryGradientStateBatch = NSArray<MPSNNMultiaryGradientState>;