objc2_metal_performance_shaders_graph/generated/
MPSGraphOperation.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    /// A symbolic representation of a compute operation.
11    ///
12    /// `NSCopy` will take a refrence, this is so `NSDictionary` can work with the tensor.
13    /// All operations are created, owned and destroyed by the graph.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshadersgraph/mpsgraphoperation?language=objc)
16    #[unsafe(super(MPSGraphObject, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(feature = "MPSGraphCore")]
19    pub struct MPSGraphOperation;
20);
21
22#[cfg(feature = "MPSGraphCore")]
23extern_conformance!(
24    unsafe impl NSCopying for MPSGraphOperation {}
25);
26
27#[cfg(feature = "MPSGraphCore")]
28unsafe impl CopyingHelper for MPSGraphOperation {
29    type Result = Self;
30}
31
32#[cfg(feature = "MPSGraphCore")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for MPSGraphOperation {}
35);
36
37#[cfg(feature = "MPSGraphCore")]
38impl MPSGraphOperation {
39    extern_methods!(
40        #[cfg(feature = "MPSGraphTensor")]
41        /// The input tensors of the operation.
42        #[unsafe(method(inputTensors))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn inputTensors(&self) -> Retained<NSArray<MPSGraphTensor>>;
45
46        #[cfg(feature = "MPSGraphTensor")]
47        /// The output tensors of the operation.
48        #[unsafe(method(outputTensors))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn outputTensors(&self) -> Retained<NSArray<MPSGraphTensor>>;
51
52        /// The set of operations guaranteed to execute before this operation.
53        #[unsafe(method(controlDependencies))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn controlDependencies(&self) -> Retained<NSArray<MPSGraphOperation>>;
56
57        #[cfg(feature = "MPSGraph")]
58        /// The graph on which the operation is defined.
59        #[unsafe(method(graph))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn graph(&self) -> Retained<MPSGraph>;
62
63        /// Name of the operation.
64        #[unsafe(method(name))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn name(&self) -> Retained<NSString>;
67
68        /// Unavailable, please utilize graph methods to create and initialize operations.
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72    );
73}
74
75/// Methods declared on superclass `NSObject`.
76#[cfg(feature = "MPSGraphCore")]
77impl MPSGraphOperation {
78    extern_methods!(
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}