objc2_core_ml/generated/
MLComputePlanDeviceUsage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// The anticipated compute devices that would be used for executing a layer/operation.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlcomputeplandeviceusage?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct MLComputePlanDeviceUsage;
16);
17
18unsafe impl Send for MLComputePlanDeviceUsage {}
19
20unsafe impl Sync for MLComputePlanDeviceUsage {}
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for MLComputePlanDeviceUsage {}
24);
25
26impl MLComputePlanDeviceUsage {
27    extern_methods!(
28        #[unsafe(method(init))]
29        #[unsafe(method_family = init)]
30        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
31
32        #[unsafe(method(new))]
33        #[unsafe(method_family = new)]
34        pub unsafe fn new() -> Retained<Self>;
35
36        #[cfg(feature = "MLComputeDeviceProtocol")]
37        /// The compute devices that can execute the layer/operation.
38        ///
39        /// This property is not atomic.
40        ///
41        /// # Safety
42        ///
43        /// This might not be thread-safe.
44        #[unsafe(method(supportedComputeDevices))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn supportedComputeDevices(
47            &self,
48        ) -> Retained<NSArray<ProtocolObject<dyn MLComputeDeviceProtocol>>>;
49
50        #[cfg(feature = "MLComputeDeviceProtocol")]
51        /// The compute device that the framework prefers to execute the layer/operation.
52        ///
53        /// This property is not atomic.
54        ///
55        /// # Safety
56        ///
57        /// This might not be thread-safe.
58        #[unsafe(method(preferredComputeDevice))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn preferredComputeDevice(
61            &self,
62        ) -> Retained<ProtocolObject<dyn MLComputeDeviceProtocol>>;
63    );
64}