objc2_core_ml/generated/
MLGPUComputeDevice.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::*;
5#[cfg(feature = "objc2-metal")]
6#[cfg(not(target_os = "watchos"))]
7use objc2_metal::*;
8
9use crate::*;
10
11extern_class!(
12    /// Represents a GPU compute device.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlgpucomputedevice?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct MLGPUComputeDevice;
18);
19
20unsafe impl Send for MLGPUComputeDevice {}
21
22unsafe impl Sync for MLGPUComputeDevice {}
23
24#[cfg(feature = "MLComputeDeviceProtocol")]
25extern_conformance!(
26    unsafe impl MLComputeDeviceProtocol for MLGPUComputeDevice {}
27);
28
29extern_conformance!(
30    unsafe impl NSObjectProtocol for MLGPUComputeDevice {}
31);
32
33impl MLGPUComputeDevice {
34    extern_methods!(
35        #[unsafe(method(init))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
38
39        #[unsafe(method(new))]
40        #[unsafe(method_family = new)]
41        pub unsafe fn new() -> Retained<Self>;
42
43        #[cfg(feature = "objc2-metal")]
44        #[cfg(not(target_os = "watchos"))]
45        /// The underlying metal device.
46        #[unsafe(method(metalDevice))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn metalDevice(&self) -> Option<Retained<ProtocolObject<dyn MTLDevice>>>;
49    );
50}