]> git.proxmox.com Git - rustc.git/blame - vendor/windows/src/Windows/Win32/AI/MachineLearning/WinML/impl.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / vendor / windows / src / Windows / Win32 / AI / MachineLearning / WinML / impl.rs
CommitLineData
353b0b11
FG
1#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
2pub trait IMLOperatorAttributes_Impl: Sized {
3 fn GetAttributeElementCount(&self, name: &::windows::core::PCSTR, r#type: MLOperatorAttributeType) -> ::windows::core::Result<u32>;
4 fn GetAttribute(&self, name: &::windows::core::PCSTR, r#type: MLOperatorAttributeType, elementcount: u32, elementbytesize: usize, value: *mut ::core::ffi::c_void) -> ::windows::core::Result<()>;
5 fn GetStringAttributeElementLength(&self, name: &::windows::core::PCSTR, elementindex: u32) -> ::windows::core::Result<u32>;
6 fn GetStringAttributeElement(&self, name: &::windows::core::PCSTR, elementindex: u32, attributeelementbytesize: u32, attributeelement: ::windows::core::PSTR) -> ::windows::core::Result<()>;
7}
8impl ::windows::core::RuntimeName for IMLOperatorAttributes {}
9impl IMLOperatorAttributes_Vtbl {
10 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorAttributes_Impl, const OFFSET: isize>() -> IMLOperatorAttributes_Vtbl {
11 unsafe extern "system" fn GetAttributeElementCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorAttributes_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, name: ::windows::core::PCSTR, r#type: MLOperatorAttributeType, elementcount: *mut u32) -> ::windows::core::HRESULT {
12 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
13 let this = (*this).get_impl();
14 match this.GetAttributeElementCount(::core::mem::transmute(&name), ::core::mem::transmute_copy(&r#type)) {
15 ::core::result::Result::Ok(ok__) => {
16 ::core::ptr::write(elementcount, ::core::mem::transmute(ok__));
17 ::windows::core::HRESULT(0)
18 }
19 ::core::result::Result::Err(err) => err.into(),
20 }
21 }
22 unsafe extern "system" fn GetAttribute<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorAttributes_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, name: ::windows::core::PCSTR, r#type: MLOperatorAttributeType, elementcount: u32, elementbytesize: usize, value: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
23 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
24 let this = (*this).get_impl();
25 this.GetAttribute(::core::mem::transmute(&name), ::core::mem::transmute_copy(&r#type), ::core::mem::transmute_copy(&elementcount), ::core::mem::transmute_copy(&elementbytesize), ::core::mem::transmute_copy(&value)).into()
26 }
27 unsafe extern "system" fn GetStringAttributeElementLength<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorAttributes_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, name: ::windows::core::PCSTR, elementindex: u32, attributeelementbytesize: *mut u32) -> ::windows::core::HRESULT {
28 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
29 let this = (*this).get_impl();
30 match this.GetStringAttributeElementLength(::core::mem::transmute(&name), ::core::mem::transmute_copy(&elementindex)) {
31 ::core::result::Result::Ok(ok__) => {
32 ::core::ptr::write(attributeelementbytesize, ::core::mem::transmute(ok__));
33 ::windows::core::HRESULT(0)
34 }
35 ::core::result::Result::Err(err) => err.into(),
36 }
37 }
38 unsafe extern "system" fn GetStringAttributeElement<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorAttributes_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, name: ::windows::core::PCSTR, elementindex: u32, attributeelementbytesize: u32, attributeelement: ::windows::core::PSTR) -> ::windows::core::HRESULT {
39 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
40 let this = (*this).get_impl();
41 this.GetStringAttributeElement(::core::mem::transmute(&name), ::core::mem::transmute_copy(&elementindex), ::core::mem::transmute_copy(&attributeelementbytesize), ::core::mem::transmute_copy(&attributeelement)).into()
42 }
43 Self {
44 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
45 GetAttributeElementCount: GetAttributeElementCount::<Identity, Impl, OFFSET>,
46 GetAttribute: GetAttribute::<Identity, Impl, OFFSET>,
47 GetStringAttributeElementLength: GetStringAttributeElementLength::<Identity, Impl, OFFSET>,
48 GetStringAttributeElement: GetStringAttributeElement::<Identity, Impl, OFFSET>,
49 }
50 }
51 pub fn matches(iid: &windows::core::GUID) -> bool {
52 iid == &<IMLOperatorAttributes as ::windows::core::ComInterface>::IID
53 }
54}
55#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
56pub trait IMLOperatorKernel_Impl: Sized {
57 fn Compute(&self, context: ::core::option::Option<&IMLOperatorKernelContext>) -> ::windows::core::Result<()>;
58}
59impl ::windows::core::RuntimeName for IMLOperatorKernel {}
60impl IMLOperatorKernel_Vtbl {
61 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernel_Impl, const OFFSET: isize>() -> IMLOperatorKernel_Vtbl {
62 unsafe extern "system" fn Compute<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernel_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, context: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
63 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
64 let this = (*this).get_impl();
65 this.Compute(::windows::core::from_raw_borrowed(&context)).into()
66 }
67 Self { base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(), Compute: Compute::<Identity, Impl, OFFSET> }
68 }
69 pub fn matches(iid: &windows::core::GUID) -> bool {
70 iid == &<IMLOperatorKernel as ::windows::core::ComInterface>::IID
71 }
72}
73#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
74pub trait IMLOperatorKernelContext_Impl: Sized {
75 fn GetInputTensor(&self, inputindex: u32) -> ::windows::core::Result<IMLOperatorTensor>;
76 fn GetOutputTensor(&self, outputindex: u32, dimensioncount: u32, dimensionsizes: *const u32) -> ::windows::core::Result<IMLOperatorTensor>;
77 fn GetOutputTensor2(&self, outputindex: u32) -> ::windows::core::Result<IMLOperatorTensor>;
78 fn AllocateTemporaryData(&self, size: usize) -> ::windows::core::Result<::windows::core::IUnknown>;
79 fn GetExecutionInterface(&self, executionobject: *mut ::core::option::Option<::windows::core::IUnknown>) -> ();
80}
81impl ::windows::core::RuntimeName for IMLOperatorKernelContext {}
82impl IMLOperatorKernelContext_Vtbl {
83 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelContext_Impl, const OFFSET: isize>() -> IMLOperatorKernelContext_Vtbl {
84 unsafe extern "system" fn GetInputTensor<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, tensor: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
85 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
86 let this = (*this).get_impl();
87 match this.GetInputTensor(::core::mem::transmute_copy(&inputindex)) {
88 ::core::result::Result::Ok(ok__) => {
89 ::core::ptr::write(tensor, ::core::mem::transmute(ok__));
90 ::windows::core::HRESULT(0)
91 }
92 ::core::result::Result::Err(err) => err.into(),
93 }
94 }
95 unsafe extern "system" fn GetOutputTensor<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, dimensioncount: u32, dimensionsizes: *const u32, tensor: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
96 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
97 let this = (*this).get_impl();
98 match this.GetOutputTensor(::core::mem::transmute_copy(&outputindex), ::core::mem::transmute_copy(&dimensioncount), ::core::mem::transmute_copy(&dimensionsizes)) {
99 ::core::result::Result::Ok(ok__) => {
100 ::core::ptr::write(tensor, ::core::mem::transmute(ok__));
101 ::windows::core::HRESULT(0)
102 }
103 ::core::result::Result::Err(err) => err.into(),
104 }
105 }
106 unsafe extern "system" fn GetOutputTensor2<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, tensor: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
107 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
108 let this = (*this).get_impl();
109 match this.GetOutputTensor2(::core::mem::transmute_copy(&outputindex)) {
110 ::core::result::Result::Ok(ok__) => {
111 ::core::ptr::write(tensor, ::core::mem::transmute(ok__));
112 ::windows::core::HRESULT(0)
113 }
114 ::core::result::Result::Err(err) => err.into(),
115 }
116 }
117 unsafe extern "system" fn AllocateTemporaryData<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, size: usize, data: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
118 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
119 let this = (*this).get_impl();
120 match this.AllocateTemporaryData(::core::mem::transmute_copy(&size)) {
121 ::core::result::Result::Ok(ok__) => {
122 ::core::ptr::write(data, ::core::mem::transmute(ok__));
123 ::windows::core::HRESULT(0)
124 }
125 ::core::result::Result::Err(err) => err.into(),
126 }
127 }
128 unsafe extern "system" fn GetExecutionInterface<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, executionobject: *mut *mut ::core::ffi::c_void) {
129 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
130 let this = (*this).get_impl();
131 this.GetExecutionInterface(::core::mem::transmute_copy(&executionobject))
132 }
133 Self {
134 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
135 GetInputTensor: GetInputTensor::<Identity, Impl, OFFSET>,
136 GetOutputTensor: GetOutputTensor::<Identity, Impl, OFFSET>,
137 GetOutputTensor2: GetOutputTensor2::<Identity, Impl, OFFSET>,
138 AllocateTemporaryData: AllocateTemporaryData::<Identity, Impl, OFFSET>,
139 GetExecutionInterface: GetExecutionInterface::<Identity, Impl, OFFSET>,
140 }
141 }
142 pub fn matches(iid: &windows::core::GUID) -> bool {
143 iid == &<IMLOperatorKernelContext as ::windows::core::ComInterface>::IID
144 }
145}
146#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
147pub trait IMLOperatorKernelCreationContext_Impl: Sized + IMLOperatorAttributes_Impl {
148 fn GetInputCount(&self) -> u32;
149 fn GetOutputCount(&self) -> u32;
150 fn IsInputValid(&self, inputindex: u32) -> bool;
151 fn IsOutputValid(&self, outputindex: u32) -> bool;
152 fn GetInputEdgeDescription(&self, inputindex: u32) -> ::windows::core::Result<MLOperatorEdgeDescription>;
153 fn GetOutputEdgeDescription(&self, outputindex: u32) -> ::windows::core::Result<MLOperatorEdgeDescription>;
154 fn HasTensorShapeDescription(&self) -> bool;
155 fn GetTensorShapeDescription(&self) -> ::windows::core::Result<IMLOperatorTensorShapeDescription>;
156 fn GetExecutionInterface(&self, executionobject: *mut ::core::option::Option<::windows::core::IUnknown>) -> ();
157}
158impl ::windows::core::RuntimeName for IMLOperatorKernelCreationContext {}
159impl IMLOperatorKernelCreationContext_Vtbl {
160 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>() -> IMLOperatorKernelCreationContext_Vtbl {
161 unsafe extern "system" fn GetInputCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
162 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
163 let this = (*this).get_impl();
164 this.GetInputCount()
165 }
166 unsafe extern "system" fn GetOutputCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
167 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
168 let this = (*this).get_impl();
169 this.GetOutputCount()
170 }
171 unsafe extern "system" fn IsInputValid<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32) -> bool {
172 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
173 let this = (*this).get_impl();
174 this.IsInputValid(::core::mem::transmute_copy(&inputindex))
175 }
176 unsafe extern "system" fn IsOutputValid<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32) -> bool {
177 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
178 let this = (*this).get_impl();
179 this.IsOutputValid(::core::mem::transmute_copy(&outputindex))
180 }
181 unsafe extern "system" fn GetInputEdgeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, edgedescription: *mut MLOperatorEdgeDescription) -> ::windows::core::HRESULT {
182 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
183 let this = (*this).get_impl();
184 match this.GetInputEdgeDescription(::core::mem::transmute_copy(&inputindex)) {
185 ::core::result::Result::Ok(ok__) => {
186 ::core::ptr::write(edgedescription, ::core::mem::transmute(ok__));
187 ::windows::core::HRESULT(0)
188 }
189 ::core::result::Result::Err(err) => err.into(),
190 }
191 }
192 unsafe extern "system" fn GetOutputEdgeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, edgedescription: *mut MLOperatorEdgeDescription) -> ::windows::core::HRESULT {
193 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
194 let this = (*this).get_impl();
195 match this.GetOutputEdgeDescription(::core::mem::transmute_copy(&outputindex)) {
196 ::core::result::Result::Ok(ok__) => {
197 ::core::ptr::write(edgedescription, ::core::mem::transmute(ok__));
198 ::windows::core::HRESULT(0)
199 }
200 ::core::result::Result::Err(err) => err.into(),
201 }
202 }
203 unsafe extern "system" fn HasTensorShapeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> bool {
204 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
205 let this = (*this).get_impl();
206 this.HasTensorShapeDescription()
207 }
208 unsafe extern "system" fn GetTensorShapeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, shapedescription: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
209 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
210 let this = (*this).get_impl();
211 match this.GetTensorShapeDescription() {
212 ::core::result::Result::Ok(ok__) => {
213 ::core::ptr::write(shapedescription, ::core::mem::transmute(ok__));
214 ::windows::core::HRESULT(0)
215 }
216 ::core::result::Result::Err(err) => err.into(),
217 }
218 }
219 unsafe extern "system" fn GetExecutionInterface<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelCreationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, executionobject: *mut *mut ::core::ffi::c_void) {
220 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
221 let this = (*this).get_impl();
222 this.GetExecutionInterface(::core::mem::transmute_copy(&executionobject))
223 }
224 Self {
225 base__: IMLOperatorAttributes_Vtbl::new::<Identity, Impl, OFFSET>(),
226 GetInputCount: GetInputCount::<Identity, Impl, OFFSET>,
227 GetOutputCount: GetOutputCount::<Identity, Impl, OFFSET>,
228 IsInputValid: IsInputValid::<Identity, Impl, OFFSET>,
229 IsOutputValid: IsOutputValid::<Identity, Impl, OFFSET>,
230 GetInputEdgeDescription: GetInputEdgeDescription::<Identity, Impl, OFFSET>,
231 GetOutputEdgeDescription: GetOutputEdgeDescription::<Identity, Impl, OFFSET>,
232 HasTensorShapeDescription: HasTensorShapeDescription::<Identity, Impl, OFFSET>,
233 GetTensorShapeDescription: GetTensorShapeDescription::<Identity, Impl, OFFSET>,
234 GetExecutionInterface: GetExecutionInterface::<Identity, Impl, OFFSET>,
235 }
236 }
237 pub fn matches(iid: &windows::core::GUID) -> bool {
238 iid == &<IMLOperatorKernelCreationContext as ::windows::core::ComInterface>::IID || iid == &<IMLOperatorAttributes as ::windows::core::ComInterface>::IID
239 }
240}
241#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
242pub trait IMLOperatorKernelFactory_Impl: Sized {
243 fn CreateKernel(&self, context: ::core::option::Option<&IMLOperatorKernelCreationContext>) -> ::windows::core::Result<IMLOperatorKernel>;
244}
245impl ::windows::core::RuntimeName for IMLOperatorKernelFactory {}
246impl IMLOperatorKernelFactory_Vtbl {
247 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelFactory_Impl, const OFFSET: isize>() -> IMLOperatorKernelFactory_Vtbl {
248 unsafe extern "system" fn CreateKernel<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorKernelFactory_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, context: *mut ::core::ffi::c_void, kernel: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
249 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
250 let this = (*this).get_impl();
251 match this.CreateKernel(::windows::core::from_raw_borrowed(&context)) {
252 ::core::result::Result::Ok(ok__) => {
253 ::core::ptr::write(kernel, ::core::mem::transmute(ok__));
254 ::windows::core::HRESULT(0)
255 }
256 ::core::result::Result::Err(err) => err.into(),
257 }
258 }
259 Self { base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(), CreateKernel: CreateKernel::<Identity, Impl, OFFSET> }
260 }
261 pub fn matches(iid: &windows::core::GUID) -> bool {
262 iid == &<IMLOperatorKernelFactory as ::windows::core::ComInterface>::IID
263 }
264}
265#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
266pub trait IMLOperatorRegistry_Impl: Sized {
267 fn RegisterOperatorSetSchema(&self, operatorsetid: *const MLOperatorSetId, baselineversion: i32, schema: *const *const MLOperatorSchemaDescription, schemacount: u32, typeinferrer: ::core::option::Option<&IMLOperatorTypeInferrer>, shapeinferrer: ::core::option::Option<&IMLOperatorShapeInferrer>) -> ::windows::core::Result<()>;
268 fn RegisterOperatorKernel(&self, operatorkernel: *const MLOperatorKernelDescription, operatorkernelfactory: ::core::option::Option<&IMLOperatorKernelFactory>, shapeinferrer: ::core::option::Option<&IMLOperatorShapeInferrer>) -> ::windows::core::Result<()>;
269}
270impl ::windows::core::RuntimeName for IMLOperatorRegistry {}
271impl IMLOperatorRegistry_Vtbl {
272 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorRegistry_Impl, const OFFSET: isize>() -> IMLOperatorRegistry_Vtbl {
273 unsafe extern "system" fn RegisterOperatorSetSchema<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorRegistry_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, operatorsetid: *const MLOperatorSetId, baselineversion: i32, schema: *const *const MLOperatorSchemaDescription, schemacount: u32, typeinferrer: *mut ::core::ffi::c_void, shapeinferrer: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
274 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
275 let this = (*this).get_impl();
276 this.RegisterOperatorSetSchema(::core::mem::transmute_copy(&operatorsetid), ::core::mem::transmute_copy(&baselineversion), ::core::mem::transmute_copy(&schema), ::core::mem::transmute_copy(&schemacount), ::windows::core::from_raw_borrowed(&typeinferrer), ::windows::core::from_raw_borrowed(&shapeinferrer)).into()
277 }
278 unsafe extern "system" fn RegisterOperatorKernel<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorRegistry_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, operatorkernel: *const MLOperatorKernelDescription, operatorkernelfactory: *mut ::core::ffi::c_void, shapeinferrer: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
279 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
280 let this = (*this).get_impl();
281 this.RegisterOperatorKernel(::core::mem::transmute_copy(&operatorkernel), ::windows::core::from_raw_borrowed(&operatorkernelfactory), ::windows::core::from_raw_borrowed(&shapeinferrer)).into()
282 }
283 Self {
284 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
285 RegisterOperatorSetSchema: RegisterOperatorSetSchema::<Identity, Impl, OFFSET>,
286 RegisterOperatorKernel: RegisterOperatorKernel::<Identity, Impl, OFFSET>,
287 }
288 }
289 pub fn matches(iid: &windows::core::GUID) -> bool {
290 iid == &<IMLOperatorRegistry as ::windows::core::ComInterface>::IID
291 }
292}
293#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
294pub trait IMLOperatorShapeInferenceContext_Impl: Sized + IMLOperatorAttributes_Impl {
295 fn GetInputCount(&self) -> u32;
296 fn GetOutputCount(&self) -> u32;
297 fn IsInputValid(&self, inputindex: u32) -> bool;
298 fn IsOutputValid(&self, outputindex: u32) -> bool;
299 fn GetInputEdgeDescription(&self, inputindex: u32) -> ::windows::core::Result<MLOperatorEdgeDescription>;
300 fn GetInputTensorDimensionCount(&self, inputindex: u32) -> ::windows::core::Result<u32>;
301 fn GetInputTensorShape(&self, inputindex: u32, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::Result<()>;
302 fn SetOutputTensorShape(&self, outputindex: u32, dimensioncount: u32, dimensions: *const u32) -> ::windows::core::Result<()>;
303}
304impl ::windows::core::RuntimeName for IMLOperatorShapeInferenceContext {}
305impl IMLOperatorShapeInferenceContext_Vtbl {
306 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>() -> IMLOperatorShapeInferenceContext_Vtbl {
307 unsafe extern "system" fn GetInputCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
308 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
309 let this = (*this).get_impl();
310 this.GetInputCount()
311 }
312 unsafe extern "system" fn GetOutputCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
313 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
314 let this = (*this).get_impl();
315 this.GetOutputCount()
316 }
317 unsafe extern "system" fn IsInputValid<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32) -> bool {
318 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
319 let this = (*this).get_impl();
320 this.IsInputValid(::core::mem::transmute_copy(&inputindex))
321 }
322 unsafe extern "system" fn IsOutputValid<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32) -> bool {
323 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
324 let this = (*this).get_impl();
325 this.IsOutputValid(::core::mem::transmute_copy(&outputindex))
326 }
327 unsafe extern "system" fn GetInputEdgeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, edgedescription: *mut MLOperatorEdgeDescription) -> ::windows::core::HRESULT {
328 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
329 let this = (*this).get_impl();
330 match this.GetInputEdgeDescription(::core::mem::transmute_copy(&inputindex)) {
331 ::core::result::Result::Ok(ok__) => {
332 ::core::ptr::write(edgedescription, ::core::mem::transmute(ok__));
333 ::windows::core::HRESULT(0)
334 }
335 ::core::result::Result::Err(err) => err.into(),
336 }
337 }
338 unsafe extern "system" fn GetInputTensorDimensionCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, dimensioncount: *mut u32) -> ::windows::core::HRESULT {
339 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
340 let this = (*this).get_impl();
341 match this.GetInputTensorDimensionCount(::core::mem::transmute_copy(&inputindex)) {
342 ::core::result::Result::Ok(ok__) => {
343 ::core::ptr::write(dimensioncount, ::core::mem::transmute(ok__));
344 ::windows::core::HRESULT(0)
345 }
346 ::core::result::Result::Err(err) => err.into(),
347 }
348 }
349 unsafe extern "system" fn GetInputTensorShape<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::HRESULT {
350 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
351 let this = (*this).get_impl();
352 this.GetInputTensorShape(::core::mem::transmute_copy(&inputindex), ::core::mem::transmute_copy(&dimensioncount), ::core::mem::transmute_copy(&dimensions)).into()
353 }
354 unsafe extern "system" fn SetOutputTensorShape<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, dimensioncount: u32, dimensions: *const u32) -> ::windows::core::HRESULT {
355 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
356 let this = (*this).get_impl();
357 this.SetOutputTensorShape(::core::mem::transmute_copy(&outputindex), ::core::mem::transmute_copy(&dimensioncount), ::core::mem::transmute_copy(&dimensions)).into()
358 }
359 Self {
360 base__: IMLOperatorAttributes_Vtbl::new::<Identity, Impl, OFFSET>(),
361 GetInputCount: GetInputCount::<Identity, Impl, OFFSET>,
362 GetOutputCount: GetOutputCount::<Identity, Impl, OFFSET>,
363 IsInputValid: IsInputValid::<Identity, Impl, OFFSET>,
364 IsOutputValid: IsOutputValid::<Identity, Impl, OFFSET>,
365 GetInputEdgeDescription: GetInputEdgeDescription::<Identity, Impl, OFFSET>,
366 GetInputTensorDimensionCount: GetInputTensorDimensionCount::<Identity, Impl, OFFSET>,
367 GetInputTensorShape: GetInputTensorShape::<Identity, Impl, OFFSET>,
368 SetOutputTensorShape: SetOutputTensorShape::<Identity, Impl, OFFSET>,
369 }
370 }
371 pub fn matches(iid: &windows::core::GUID) -> bool {
372 iid == &<IMLOperatorShapeInferenceContext as ::windows::core::ComInterface>::IID || iid == &<IMLOperatorAttributes as ::windows::core::ComInterface>::IID
373 }
374}
375#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
376pub trait IMLOperatorShapeInferrer_Impl: Sized {
377 fn InferOutputShapes(&self, context: ::core::option::Option<&IMLOperatorShapeInferenceContext>) -> ::windows::core::Result<()>;
378}
379impl ::windows::core::RuntimeName for IMLOperatorShapeInferrer {}
380impl IMLOperatorShapeInferrer_Vtbl {
381 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferrer_Impl, const OFFSET: isize>() -> IMLOperatorShapeInferrer_Vtbl {
382 unsafe extern "system" fn InferOutputShapes<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorShapeInferrer_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, context: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
383 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
384 let this = (*this).get_impl();
385 this.InferOutputShapes(::windows::core::from_raw_borrowed(&context)).into()
386 }
387 Self { base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(), InferOutputShapes: InferOutputShapes::<Identity, Impl, OFFSET> }
388 }
389 pub fn matches(iid: &windows::core::GUID) -> bool {
390 iid == &<IMLOperatorShapeInferrer as ::windows::core::ComInterface>::IID
391 }
392}
393#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
394pub trait IMLOperatorTensor_Impl: Sized {
395 fn GetDimensionCount(&self) -> u32;
396 fn GetShape(&self, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::Result<()>;
397 fn GetTensorDataType(&self) -> MLOperatorTensorDataType;
398 fn IsCpuData(&self) -> bool;
399 fn IsDataInterface(&self) -> bool;
400 fn GetData(&self) -> *mut ::core::ffi::c_void;
401 fn GetDataInterface(&self, datainterface: *mut ::core::option::Option<::windows::core::IUnknown>) -> ();
402}
403impl ::windows::core::RuntimeName for IMLOperatorTensor {}
404impl IMLOperatorTensor_Vtbl {
405 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>() -> IMLOperatorTensor_Vtbl {
406 unsafe extern "system" fn GetDimensionCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
407 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
408 let this = (*this).get_impl();
409 this.GetDimensionCount()
410 }
411 unsafe extern "system" fn GetShape<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::HRESULT {
412 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
413 let this = (*this).get_impl();
414 this.GetShape(::core::mem::transmute_copy(&dimensioncount), ::core::mem::transmute_copy(&dimensions)).into()
415 }
416 unsafe extern "system" fn GetTensorDataType<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> MLOperatorTensorDataType {
417 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
418 let this = (*this).get_impl();
419 this.GetTensorDataType()
420 }
421 unsafe extern "system" fn IsCpuData<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> bool {
422 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
423 let this = (*this).get_impl();
424 this.IsCpuData()
425 }
426 unsafe extern "system" fn IsDataInterface<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> bool {
427 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
428 let this = (*this).get_impl();
429 this.IsDataInterface()
430 }
431 unsafe extern "system" fn GetData<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void {
432 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
433 let this = (*this).get_impl();
434 this.GetData()
435 }
436 unsafe extern "system" fn GetDataInterface<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensor_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, datainterface: *mut *mut ::core::ffi::c_void) {
437 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
438 let this = (*this).get_impl();
439 this.GetDataInterface(::core::mem::transmute_copy(&datainterface))
440 }
441 Self {
442 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
443 GetDimensionCount: GetDimensionCount::<Identity, Impl, OFFSET>,
444 GetShape: GetShape::<Identity, Impl, OFFSET>,
445 GetTensorDataType: GetTensorDataType::<Identity, Impl, OFFSET>,
446 IsCpuData: IsCpuData::<Identity, Impl, OFFSET>,
447 IsDataInterface: IsDataInterface::<Identity, Impl, OFFSET>,
448 GetData: GetData::<Identity, Impl, OFFSET>,
449 GetDataInterface: GetDataInterface::<Identity, Impl, OFFSET>,
450 }
451 }
452 pub fn matches(iid: &windows::core::GUID) -> bool {
453 iid == &<IMLOperatorTensor as ::windows::core::ComInterface>::IID
454 }
455}
456#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
457pub trait IMLOperatorTensorShapeDescription_Impl: Sized {
458 fn GetInputTensorDimensionCount(&self, inputindex: u32) -> ::windows::core::Result<u32>;
459 fn GetInputTensorShape(&self, inputindex: u32, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::Result<()>;
460 fn HasOutputShapeDescription(&self) -> bool;
461 fn GetOutputTensorDimensionCount(&self, outputindex: u32) -> ::windows::core::Result<u32>;
462 fn GetOutputTensorShape(&self, outputindex: u32, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::Result<()>;
463}
464impl ::windows::core::RuntimeName for IMLOperatorTensorShapeDescription {}
465impl IMLOperatorTensorShapeDescription_Vtbl {
466 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensorShapeDescription_Impl, const OFFSET: isize>() -> IMLOperatorTensorShapeDescription_Vtbl {
467 unsafe extern "system" fn GetInputTensorDimensionCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensorShapeDescription_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, dimensioncount: *mut u32) -> ::windows::core::HRESULT {
468 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
469 let this = (*this).get_impl();
470 match this.GetInputTensorDimensionCount(::core::mem::transmute_copy(&inputindex)) {
471 ::core::result::Result::Ok(ok__) => {
472 ::core::ptr::write(dimensioncount, ::core::mem::transmute(ok__));
473 ::windows::core::HRESULT(0)
474 }
475 ::core::result::Result::Err(err) => err.into(),
476 }
477 }
478 unsafe extern "system" fn GetInputTensorShape<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensorShapeDescription_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::HRESULT {
479 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
480 let this = (*this).get_impl();
481 this.GetInputTensorShape(::core::mem::transmute_copy(&inputindex), ::core::mem::transmute_copy(&dimensioncount), ::core::mem::transmute_copy(&dimensions)).into()
482 }
483 unsafe extern "system" fn HasOutputShapeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensorShapeDescription_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> bool {
484 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
485 let this = (*this).get_impl();
486 this.HasOutputShapeDescription()
487 }
488 unsafe extern "system" fn GetOutputTensorDimensionCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensorShapeDescription_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, dimensioncount: *mut u32) -> ::windows::core::HRESULT {
489 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
490 let this = (*this).get_impl();
491 match this.GetOutputTensorDimensionCount(::core::mem::transmute_copy(&outputindex)) {
492 ::core::result::Result::Ok(ok__) => {
493 ::core::ptr::write(dimensioncount, ::core::mem::transmute(ok__));
494 ::windows::core::HRESULT(0)
495 }
496 ::core::result::Result::Err(err) => err.into(),
497 }
498 }
499 unsafe extern "system" fn GetOutputTensorShape<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTensorShapeDescription_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, dimensioncount: u32, dimensions: *mut u32) -> ::windows::core::HRESULT {
500 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
501 let this = (*this).get_impl();
502 this.GetOutputTensorShape(::core::mem::transmute_copy(&outputindex), ::core::mem::transmute_copy(&dimensioncount), ::core::mem::transmute_copy(&dimensions)).into()
503 }
504 Self {
505 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
506 GetInputTensorDimensionCount: GetInputTensorDimensionCount::<Identity, Impl, OFFSET>,
507 GetInputTensorShape: GetInputTensorShape::<Identity, Impl, OFFSET>,
508 HasOutputShapeDescription: HasOutputShapeDescription::<Identity, Impl, OFFSET>,
509 GetOutputTensorDimensionCount: GetOutputTensorDimensionCount::<Identity, Impl, OFFSET>,
510 GetOutputTensorShape: GetOutputTensorShape::<Identity, Impl, OFFSET>,
511 }
512 }
513 pub fn matches(iid: &windows::core::GUID) -> bool {
514 iid == &<IMLOperatorTensorShapeDescription as ::windows::core::ComInterface>::IID
515 }
516}
517#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
518pub trait IMLOperatorTypeInferenceContext_Impl: Sized + IMLOperatorAttributes_Impl {
519 fn GetInputCount(&self) -> u32;
520 fn GetOutputCount(&self) -> u32;
521 fn IsInputValid(&self, inputindex: u32) -> bool;
522 fn IsOutputValid(&self, outputindex: u32) -> bool;
523 fn GetInputEdgeDescription(&self, inputindex: u32) -> ::windows::core::Result<MLOperatorEdgeDescription>;
524 fn SetOutputEdgeDescription(&self, outputindex: u32, edgedescription: *const MLOperatorEdgeDescription) -> ::windows::core::Result<()>;
525}
526impl ::windows::core::RuntimeName for IMLOperatorTypeInferenceContext {}
527impl IMLOperatorTypeInferenceContext_Vtbl {
528 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>() -> IMLOperatorTypeInferenceContext_Vtbl {
529 unsafe extern "system" fn GetInputCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
530 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
531 let this = (*this).get_impl();
532 this.GetInputCount()
533 }
534 unsafe extern "system" fn GetOutputCount<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> u32 {
535 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
536 let this = (*this).get_impl();
537 this.GetOutputCount()
538 }
539 unsafe extern "system" fn IsInputValid<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32) -> bool {
540 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
541 let this = (*this).get_impl();
542 this.IsInputValid(::core::mem::transmute_copy(&inputindex))
543 }
544 unsafe extern "system" fn IsOutputValid<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32) -> bool {
545 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
546 let this = (*this).get_impl();
547 this.IsOutputValid(::core::mem::transmute_copy(&outputindex))
548 }
549 unsafe extern "system" fn GetInputEdgeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, inputindex: u32, edgedescription: *mut MLOperatorEdgeDescription) -> ::windows::core::HRESULT {
550 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
551 let this = (*this).get_impl();
552 match this.GetInputEdgeDescription(::core::mem::transmute_copy(&inputindex)) {
553 ::core::result::Result::Ok(ok__) => {
554 ::core::ptr::write(edgedescription, ::core::mem::transmute(ok__));
555 ::windows::core::HRESULT(0)
556 }
557 ::core::result::Result::Err(err) => err.into(),
558 }
559 }
560 unsafe extern "system" fn SetOutputEdgeDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferenceContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, outputindex: u32, edgedescription: *const MLOperatorEdgeDescription) -> ::windows::core::HRESULT {
561 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
562 let this = (*this).get_impl();
563 this.SetOutputEdgeDescription(::core::mem::transmute_copy(&outputindex), ::core::mem::transmute_copy(&edgedescription)).into()
564 }
565 Self {
566 base__: IMLOperatorAttributes_Vtbl::new::<Identity, Impl, OFFSET>(),
567 GetInputCount: GetInputCount::<Identity, Impl, OFFSET>,
568 GetOutputCount: GetOutputCount::<Identity, Impl, OFFSET>,
569 IsInputValid: IsInputValid::<Identity, Impl, OFFSET>,
570 IsOutputValid: IsOutputValid::<Identity, Impl, OFFSET>,
571 GetInputEdgeDescription: GetInputEdgeDescription::<Identity, Impl, OFFSET>,
572 SetOutputEdgeDescription: SetOutputEdgeDescription::<Identity, Impl, OFFSET>,
573 }
574 }
575 pub fn matches(iid: &windows::core::GUID) -> bool {
576 iid == &<IMLOperatorTypeInferenceContext as ::windows::core::ComInterface>::IID || iid == &<IMLOperatorAttributes as ::windows::core::ComInterface>::IID
577 }
578}
579#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
580pub trait IMLOperatorTypeInferrer_Impl: Sized {
581 fn InferOutputTypes(&self, context: ::core::option::Option<&IMLOperatorTypeInferenceContext>) -> ::windows::core::Result<()>;
582}
583impl ::windows::core::RuntimeName for IMLOperatorTypeInferrer {}
584impl IMLOperatorTypeInferrer_Vtbl {
585 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferrer_Impl, const OFFSET: isize>() -> IMLOperatorTypeInferrer_Vtbl {
586 unsafe extern "system" fn InferOutputTypes<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IMLOperatorTypeInferrer_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, context: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
587 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
588 let this = (*this).get_impl();
589 this.InferOutputTypes(::windows::core::from_raw_borrowed(&context)).into()
590 }
591 Self { base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(), InferOutputTypes: InferOutputTypes::<Identity, Impl, OFFSET> }
592 }
593 pub fn matches(iid: &windows::core::GUID) -> bool {
594 iid == &<IMLOperatorTypeInferrer as ::windows::core::ComInterface>::IID
595 }
596}
597#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"Win32_Graphics_Direct3D12\"`, `\"implement\"`*"]
598#[cfg(feature = "Win32_Graphics_Direct3D12")]
599pub trait IWinMLEvaluationContext_Impl: Sized {
600 fn BindValue(&self, pdescriptor: *const WINML_BINDING_DESC) -> ::windows::core::Result<()>;
601 fn GetValueByName(&self, name: &::windows::core::PCWSTR) -> ::windows::core::Result<*mut WINML_BINDING_DESC>;
602 fn Clear(&self) -> ::windows::core::Result<()>;
603}
604#[cfg(feature = "Win32_Graphics_Direct3D12")]
605impl ::windows::core::RuntimeName for IWinMLEvaluationContext {}
606#[cfg(feature = "Win32_Graphics_Direct3D12")]
607impl IWinMLEvaluationContext_Vtbl {
608 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLEvaluationContext_Impl, const OFFSET: isize>() -> IWinMLEvaluationContext_Vtbl {
609 unsafe extern "system" fn BindValue<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLEvaluationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, pdescriptor: *const WINML_BINDING_DESC) -> ::windows::core::HRESULT {
610 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
611 let this = (*this).get_impl();
612 this.BindValue(::core::mem::transmute_copy(&pdescriptor)).into()
613 }
614 unsafe extern "system" fn GetValueByName<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLEvaluationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, name: ::windows::core::PCWSTR, pdescriptor: *mut *mut WINML_BINDING_DESC) -> ::windows::core::HRESULT {
615 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
616 let this = (*this).get_impl();
617 match this.GetValueByName(::core::mem::transmute(&name)) {
618 ::core::result::Result::Ok(ok__) => {
619 ::core::ptr::write(pdescriptor, ::core::mem::transmute(ok__));
620 ::windows::core::HRESULT(0)
621 }
622 ::core::result::Result::Err(err) => err.into(),
623 }
624 }
625 unsafe extern "system" fn Clear<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLEvaluationContext_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
626 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
627 let this = (*this).get_impl();
628 this.Clear().into()
629 }
630 Self {
631 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
632 BindValue: BindValue::<Identity, Impl, OFFSET>,
633 GetValueByName: GetValueByName::<Identity, Impl, OFFSET>,
634 Clear: Clear::<Identity, Impl, OFFSET>,
635 }
636 }
637 pub fn matches(iid: &windows::core::GUID) -> bool {
638 iid == &<IWinMLEvaluationContext as ::windows::core::ComInterface>::IID
639 }
640}
641#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"Win32_Foundation\"`, `\"implement\"`*"]
642#[cfg(feature = "Win32_Foundation")]
643pub trait IWinMLModel_Impl: Sized {
644 fn GetDescription(&self) -> ::windows::core::Result<*mut WINML_MODEL_DESC>;
645 fn EnumerateMetadata(&self, index: u32, pkey: *mut ::windows::core::PWSTR, pvalue: *mut ::windows::core::PWSTR) -> ::windows::core::Result<()>;
646 fn EnumerateModelInputs(&self, index: u32) -> ::windows::core::Result<*mut WINML_VARIABLE_DESC>;
647 fn EnumerateModelOutputs(&self, index: u32) -> ::windows::core::Result<*mut WINML_VARIABLE_DESC>;
648}
649#[cfg(feature = "Win32_Foundation")]
650impl ::windows::core::RuntimeName for IWinMLModel {}
651#[cfg(feature = "Win32_Foundation")]
652impl IWinMLModel_Vtbl {
653 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLModel_Impl, const OFFSET: isize>() -> IWinMLModel_Vtbl {
654 unsafe extern "system" fn GetDescription<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLModel_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, ppdescription: *mut *mut WINML_MODEL_DESC) -> ::windows::core::HRESULT {
655 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
656 let this = (*this).get_impl();
657 match this.GetDescription() {
658 ::core::result::Result::Ok(ok__) => {
659 ::core::ptr::write(ppdescription, ::core::mem::transmute(ok__));
660 ::windows::core::HRESULT(0)
661 }
662 ::core::result::Result::Err(err) => err.into(),
663 }
664 }
665 unsafe extern "system" fn EnumerateMetadata<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLModel_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, index: u32, pkey: *mut ::windows::core::PWSTR, pvalue: *mut ::windows::core::PWSTR) -> ::windows::core::HRESULT {
666 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
667 let this = (*this).get_impl();
668 this.EnumerateMetadata(::core::mem::transmute_copy(&index), ::core::mem::transmute_copy(&pkey), ::core::mem::transmute_copy(&pvalue)).into()
669 }
670 unsafe extern "system" fn EnumerateModelInputs<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLModel_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, index: u32, ppinputdescriptor: *mut *mut WINML_VARIABLE_DESC) -> ::windows::core::HRESULT {
671 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
672 let this = (*this).get_impl();
673 match this.EnumerateModelInputs(::core::mem::transmute_copy(&index)) {
674 ::core::result::Result::Ok(ok__) => {
675 ::core::ptr::write(ppinputdescriptor, ::core::mem::transmute(ok__));
676 ::windows::core::HRESULT(0)
677 }
678 ::core::result::Result::Err(err) => err.into(),
679 }
680 }
681 unsafe extern "system" fn EnumerateModelOutputs<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLModel_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, index: u32, ppoutputdescriptor: *mut *mut WINML_VARIABLE_DESC) -> ::windows::core::HRESULT {
682 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
683 let this = (*this).get_impl();
684 match this.EnumerateModelOutputs(::core::mem::transmute_copy(&index)) {
685 ::core::result::Result::Ok(ok__) => {
686 ::core::ptr::write(ppoutputdescriptor, ::core::mem::transmute(ok__));
687 ::windows::core::HRESULT(0)
688 }
689 ::core::result::Result::Err(err) => err.into(),
690 }
691 }
692 Self {
693 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
694 GetDescription: GetDescription::<Identity, Impl, OFFSET>,
695 EnumerateMetadata: EnumerateMetadata::<Identity, Impl, OFFSET>,
696 EnumerateModelInputs: EnumerateModelInputs::<Identity, Impl, OFFSET>,
697 EnumerateModelOutputs: EnumerateModelOutputs::<Identity, Impl, OFFSET>,
698 }
699 }
700 pub fn matches(iid: &windows::core::GUID) -> bool {
701 iid == &<IWinMLModel as ::windows::core::ComInterface>::IID
702 }
703}
704#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"Win32_Graphics_Direct3D12\"`, `\"implement\"`*"]
705#[cfg(feature = "Win32_Graphics_Direct3D12")]
706pub trait IWinMLRuntime_Impl: Sized {
707 fn LoadModel(&self, path: &::windows::core::PCWSTR) -> ::windows::core::Result<IWinMLModel>;
708 fn CreateEvaluationContext(&self, device: ::core::option::Option<&super::super::super::Graphics::Direct3D12::ID3D12Device>) -> ::windows::core::Result<IWinMLEvaluationContext>;
709 fn EvaluateModel(&self, pcontext: ::core::option::Option<&IWinMLEvaluationContext>) -> ::windows::core::Result<()>;
710}
711#[cfg(feature = "Win32_Graphics_Direct3D12")]
712impl ::windows::core::RuntimeName for IWinMLRuntime {}
713#[cfg(feature = "Win32_Graphics_Direct3D12")]
714impl IWinMLRuntime_Vtbl {
715 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLRuntime_Impl, const OFFSET: isize>() -> IWinMLRuntime_Vtbl {
716 unsafe extern "system" fn LoadModel<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLRuntime_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, path: ::windows::core::PCWSTR, ppmodel: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
717 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
718 let this = (*this).get_impl();
719 match this.LoadModel(::core::mem::transmute(&path)) {
720 ::core::result::Result::Ok(ok__) => {
721 ::core::ptr::write(ppmodel, ::core::mem::transmute(ok__));
722 ::windows::core::HRESULT(0)
723 }
724 ::core::result::Result::Err(err) => err.into(),
725 }
726 }
727 unsafe extern "system" fn CreateEvaluationContext<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLRuntime_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, device: *mut ::core::ffi::c_void, ppcontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
728 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
729 let this = (*this).get_impl();
730 match this.CreateEvaluationContext(::windows::core::from_raw_borrowed(&device)) {
731 ::core::result::Result::Ok(ok__) => {
732 ::core::ptr::write(ppcontext, ::core::mem::transmute(ok__));
733 ::windows::core::HRESULT(0)
734 }
735 ::core::result::Result::Err(err) => err.into(),
736 }
737 }
738 unsafe extern "system" fn EvaluateModel<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLRuntime_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, pcontext: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
739 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
740 let this = (*this).get_impl();
741 this.EvaluateModel(::windows::core::from_raw_borrowed(&pcontext)).into()
742 }
743 Self {
744 base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(),
745 LoadModel: LoadModel::<Identity, Impl, OFFSET>,
746 CreateEvaluationContext: CreateEvaluationContext::<Identity, Impl, OFFSET>,
747 EvaluateModel: EvaluateModel::<Identity, Impl, OFFSET>,
748 }
749 }
750 pub fn matches(iid: &windows::core::GUID) -> bool {
751 iid == &<IWinMLRuntime as ::windows::core::ComInterface>::IID
752 }
753}
754#[doc = "*Required features: `\"Win32_AI_MachineLearning_WinML\"`, `\"implement\"`*"]
755pub trait IWinMLRuntimeFactory_Impl: Sized {
756 fn CreateRuntime(&self, runtimetype: WINML_RUNTIME_TYPE) -> ::windows::core::Result<IWinMLRuntime>;
757}
758impl ::windows::core::RuntimeName for IWinMLRuntimeFactory {}
759impl IWinMLRuntimeFactory_Vtbl {
760 pub const fn new<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLRuntimeFactory_Impl, const OFFSET: isize>() -> IWinMLRuntimeFactory_Vtbl {
761 unsafe extern "system" fn CreateRuntime<Identity: ::windows::core::IUnknownImpl<Impl = Impl>, Impl: IWinMLRuntimeFactory_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, runtimetype: WINML_RUNTIME_TYPE, ppruntime: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
762 let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
763 let this = (*this).get_impl();
764 match this.CreateRuntime(::core::mem::transmute_copy(&runtimetype)) {
765 ::core::result::Result::Ok(ok__) => {
766 ::core::ptr::write(ppruntime, ::core::mem::transmute(ok__));
767 ::windows::core::HRESULT(0)
768 }
769 ::core::result::Result::Err(err) => err.into(),
770 }
771 }
772 Self { base__: ::windows::core::IUnknown_Vtbl::new::<Identity, OFFSET>(), CreateRuntime: CreateRuntime::<Identity, Impl, OFFSET> }
773 }
774 pub fn matches(iid: &windows::core::GUID) -> bool {
775 iid == &<IWinMLRuntimeFactory as ::windows::core::ComInterface>::IID
776 }
777}