1 #pragma once 2 3 #include <MetalPerformanceShadersGraph/MetalPerformanceShadersGraph.h> 4 5 #if !defined(__MAC_15_0) && \ 6 (!defined(MAC_OS_X_VERSION_15_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_15_0)) 7 8 @interface MPSNDArrayIdentity : MPSNDArrayUnaryKernel 9 -(MPSNDArray * __nullable) reshapeWithCommandBuffer: (__nullable id <MTLCommandBuffer>) cmdBuf 10 sourceArray: (MPSNDArray * __nonnull) sourceArray 11 shape: (MPSShape * __nonnull) shape 12 destinationArray: (MPSNDArray * __nullable) destinationArray; 13 @end 14 15 @interface MPSNDArrayDescriptor() 16 @property (readwrite, nonatomic) BOOL preferPackedRows; 17 @end 18 19 @interface MPSNDArray() 20 -(nonnull instancetype) initWithBuffer:(id<MTLBuffer> _Nonnull) buffer 21 offset:(NSUInteger) offset 22 descriptor:(MPSNDArrayDescriptor * _Nonnull) descriptor; 23 -(MPSNDArray * __nullable) arrayViewWithShape:(MPSShape * _Nullable) shape 24 strides:(MPSShape * _Nonnull) strides; 25 @end 26 27 typedef NS_ENUM(NSInteger, MTLMathMode) 28 { 29 MTLMathModeSafe = 0, 30 MTLMathModeRelaxed = 1, 31 MTLMathModeFast = 2, 32 }; 33 34 @interface MTLCompileOptions() 35 @property (readwrite, nonatomic) MTLMathMode mathMode; 36 @end 37 38 #endif 39