objc2_metal/generated/
MTL4MachineLearningPipeline.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(MTL4PipelineDescriptor, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(feature = "MTL4PipelineState")]
17 pub struct MTL4MachineLearningPipelineDescriptor;
18);
19
20#[cfg(feature = "MTL4PipelineState")]
21extern_conformance!(
22 unsafe impl NSCopying for MTL4MachineLearningPipelineDescriptor {}
23);
24
25#[cfg(feature = "MTL4PipelineState")]
26unsafe impl CopyingHelper for MTL4MachineLearningPipelineDescriptor {
27 type Result = Self;
28}
29
30#[cfg(feature = "MTL4PipelineState")]
31extern_conformance!(
32 unsafe impl NSObjectProtocol for MTL4MachineLearningPipelineDescriptor {}
33);
34
35#[cfg(feature = "MTL4PipelineState")]
36impl MTL4MachineLearningPipelineDescriptor {
37 extern_methods!(
38 #[unsafe(method(label))]
40 #[unsafe(method_family = none)]
41 pub fn label(&self) -> Option<Retained<NSString>>;
42
43 #[unsafe(method(setLabel:))]
47 #[unsafe(method_family = none)]
48 pub fn setLabel(&self, label: Option<&NSString>);
49
50 #[cfg(feature = "MTL4FunctionDescriptor")]
51 #[unsafe(method(machineLearningFunctionDescriptor))]
53 #[unsafe(method_family = none)]
54 pub fn machineLearningFunctionDescriptor(&self)
55 -> Option<Retained<MTL4FunctionDescriptor>>;
56
57 #[cfg(feature = "MTL4FunctionDescriptor")]
58 #[unsafe(method(setMachineLearningFunctionDescriptor:))]
62 #[unsafe(method_family = none)]
63 pub fn setMachineLearningFunctionDescriptor(
64 &self,
65 machine_learning_function_descriptor: Option<&MTL4FunctionDescriptor>,
66 );
67
68 #[cfg(feature = "MTLTensor")]
69 #[unsafe(method(setInputDimensions:atBufferIndex:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setInputDimensions_atBufferIndex(
81 &self,
82 dimensions: Option<&MTLTensorExtents>,
83 buffer_index: NSInteger,
84 );
85
86 #[cfg(feature = "MTLTensor")]
87 #[unsafe(method(setInputDimensions:withRange:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setInputDimensions_withRange(
108 &self,
109 dimensions: &NSArray<MTLTensorExtents>,
110 range: NSRange,
111 );
112
113 #[cfg(feature = "MTLTensor")]
114 #[unsafe(method(inputDimensionsAtBufferIndex:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn inputDimensionsAtBufferIndex(
122 &self,
123 buffer_index: NSInteger,
124 ) -> Option<Retained<MTLTensorExtents>>;
125
126 #[unsafe(method(reset))]
128 #[unsafe(method_family = none)]
129 pub fn reset(&self);
130 );
131}
132
133#[cfg(feature = "MTL4PipelineState")]
135impl MTL4MachineLearningPipelineDescriptor {
136 extern_methods!(
137 #[unsafe(method(init))]
138 #[unsafe(method_family = init)]
139 pub fn init(this: Allocated<Self>) -> Retained<Self>;
140
141 #[unsafe(method(new))]
142 #[unsafe(method_family = new)]
143 pub fn new() -> Retained<Self>;
144 );
145}
146
147#[cfg(feature = "MTL4PipelineState")]
148impl DefaultRetained for MTL4MachineLearningPipelineDescriptor {
149 #[inline]
150 fn default_retained() -> Retained<Self> {
151 Self::new()
152 }
153}
154
155extern_class!(
156 #[unsafe(super(NSObject))]
160 #[derive(Debug, PartialEq, Eq, Hash)]
161 pub struct MTL4MachineLearningPipelineReflection;
162);
163
164unsafe impl Send for MTL4MachineLearningPipelineReflection {}
165
166unsafe impl Sync for MTL4MachineLearningPipelineReflection {}
167
168extern_conformance!(
169 unsafe impl NSObjectProtocol for MTL4MachineLearningPipelineReflection {}
170);
171
172impl MTL4MachineLearningPipelineReflection {
173 extern_methods!(
174 #[cfg(feature = "MTLArgument")]
175 #[unsafe(method(bindings))]
177 #[unsafe(method_family = none)]
178 pub fn bindings(&self) -> Retained<NSArray<ProtocolObject<dyn MTLBinding>>>;
179 );
180}
181
182impl MTL4MachineLearningPipelineReflection {
184 extern_methods!(
185 #[unsafe(method(init))]
186 #[unsafe(method_family = init)]
187 pub fn init(this: Allocated<Self>) -> Retained<Self>;
188
189 #[unsafe(method(new))]
190 #[unsafe(method_family = new)]
191 pub fn new() -> Retained<Self>;
192 );
193}
194
195impl DefaultRetained for MTL4MachineLearningPipelineReflection {
196 #[inline]
197 fn default_retained() -> Retained<Self> {
198 Self::new()
199 }
200}
201
202extern_protocol!(
203 #[cfg(feature = "MTLAllocation")]
209 pub unsafe trait MTL4MachineLearningPipelineState:
210 MTLAllocation + NSObjectProtocol + Send + Sync
211 {
212 #[unsafe(method(label))]
214 #[unsafe(method_family = none)]
215 fn label(&self) -> Option<Retained<NSString>>;
216
217 #[cfg(feature = "MTLDevice")]
218 #[unsafe(method(device))]
220 #[unsafe(method_family = none)]
221 fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>;
222
223 #[unsafe(method(reflection))]
225 #[unsafe(method_family = none)]
226 fn reflection(&self) -> Option<Retained<MTL4MachineLearningPipelineReflection>>;
227
228 #[unsafe(method(intermediatesHeapSize))]
236 #[unsafe(method_family = none)]
237 fn intermediatesHeapSize(&self) -> NSUInteger;
238 }
239);