Skip to content

MetalPerformanceShadersGraph iOS xcode13.3 beta3

Alex Soto edited this page Mar 3, 2022 · 1 revision

#MetalPerformanceShadersGraph.framework

diff -ruN /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h
--- /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h	2022-02-04 13:41:47.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h	2022-02-17 18:14:30.000000000 -0500
@@ -49,6 +49,19 @@
     MPSGraphOptimizationLevel1                        MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))                        =   1L,
 };
 
+/*!
+ *  @typedef    MPSGraphOptimizationProfile
+ *  @abstract   Optimization profile used as heuristic as graph compiler optimizes network
+ *
+ *  @constant   MPSGraphOptimizationProfilePerformance                               Default, optimize for performance
+ *  @constant   MPSGraphOptimizationProfilePowerEfficiency                          optimize for power efficiency
+ */
+typedef NS_ENUM(uint64_t, MPSGraphOptimizationProfile)
+{
+    MPSGraphOptimizationProfilePerformance                        MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)) MPS_SWIFT_NAME(performance) =   0,
+    MPSGraphOptimizationProfilePowerEfficiency                    MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))                             =   1L,
+};
+
 /*! @abstract   A dictionary of tensors and correspondiing tensorData for them
  */
 MPS_AVAILABLE_STARTING(macos(11.0), ios(14.0), tvos(14.0))
@@ -90,6 +103,11 @@
  */
 @property (readwrite, nonatomic) MPSGraphOptimization optimizationLevel MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
 
+/*! @property   optimizationProfile
+ *  @discussion optimization profile for the graph optimization, default is MPSGraphOptimizationProfilePerformance
+ */
+@property (readwrite, nonatomic) MPSGraphOptimizationProfile optimizationProfile MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
 @end
 
 /*! @class      MPSGraphExecutionDescriptor
diff -ruN /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphGatherOps.h /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphGatherOps.h
--- /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphGatherOps.h	2022-02-04 13:46:12.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphGatherOps.h	2022-02-17 16:57:00.000000000 -0500
@@ -91,6 +91,50 @@
 
 @end
 
+@interface MPSGraph(MPSGraphGatherAlongAxisOps)
+
+/*!
+ *  @abstract   Create GatherAlongAxis op and return the result tensor
+ *  @discussion Gather values from `updatesTensor` along the specified `axis` at indices in `indicesTensor`.
+ *              The shape of `updatesTensor` and `indicesTensor` must match except at `axis`.
+ *              The shape of the result tensor is equal to the shape of `indicesTensor`.
+ *              If an index is out of bounds of the `updatesTensor` along `axis` a 0 is inserted.
+ *
+ *  @param      axis                          The axis to gather from. Negative values wrap around
+ *  @param      updatesTensor      The input tensor to gather values from
+ *  @param      indicesTensor      Int32 or Int64 tensor used to index `updatesTensor`
+ *  @param      name                          The name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object
+*/
+
+-(MPSGraphTensor *) gatherAlongAxis:(NSInteger) axis
+                  withUpdatesTensor:(MPSGraphTensor *) updatesTensor
+                      indicesTensor:(MPSGraphTensor *) indicesTensor
+                               name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( gatherAlongAxis(_:updates:indices:name:) )
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
+/*!
+ *  @abstract   Create GatherAlongAxis op and return the result tensor
+ *  @discussion See above discussion of gatherAlongAxis: withUpdatesTensor: indicesTensor: name:
+ *
+ *  @param      axisTensor            Scalar Int32 tensor. The axis to gather from. Negative values wrap around
+ *  @param      updatesTensor      The input tensor to gather values from
+ *  @param      indicesTensor      Int32 or Int64 tensor used to index `updatesTensor`
+ *  @param      name                          The name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object
+*/
+-(MPSGraphTensor *) gatherAlongAxisTensor:(MPSGraphTensor *) axisTensor
+                        withUpdatesTensor:(MPSGraphTensor *) updatesTensor
+                            indicesTensor:(MPSGraphTensor *) indicesTensor
+                                     name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( gatherAlongAxisTensor(_:updates:indices:name:) )
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
+@end
+
 NS_ASSUME_NONNULL_END
 
 #endif /* MPSGatherOps_h */
diff -ruN /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRandomOps.h /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRandomOps.h
--- /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRandomOps.h	2022-02-04 13:41:46.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphRandomOps.h	2022-02-17 16:57:20.000000000 -0500
@@ -23,9 +23,9 @@
  */
 typedef NS_ENUM(uint64_t, MPSGraphRandomDistribution)
 {
-    MPSGraphRandomDistributionUniform            MPS_ENUM_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4)) MPS_SWIFT_NAME(uniform) =   0,
-    MPSGraphRandomDistributionNormal         MPS_ENUM_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4))                        =   1L,
-    MPSGraphRandomDistributionTruncatedNormal         MPS_ENUM_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4))                        =   2L,
+    MPSGraphRandomDistributionUniform            MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)) MPS_SWIFT_NAME(uniform) =   0,
+    MPSGraphRandomDistributionNormal         MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))                        =   1L,
+    MPSGraphRandomDistributionTruncatedNormal         MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))                        =   2L,
 };
 
 /*!
@@ -37,8 +37,8 @@
  */
 typedef NS_ENUM(uint64_t, MPSGraphRandomNormalSamplingMethod)
 {
-    MPSGraphRandomNormalSamplingInvCDF            MPS_ENUM_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4)) MPS_SWIFT_NAME(invCDF) =   0,
-    MPSGraphRandomNormalSamplingBoxMuller         MPS_ENUM_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4))                        =   1L,
+    MPSGraphRandomNormalSamplingInvCDF            MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4)) MPS_SWIFT_NAME(invCDF) =   0,
+    MPSGraphRandomNormalSamplingBoxMuller         MPS_ENUM_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4))                        =   1L,
 };
 
 @interface MPSGraphRandomOpDescriptor : NSObject<NSCopying>
diff -ruN /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphScatterNDOps.h /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphScatterNDOps.h
--- /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphScatterNDOps.h	2022-02-03 17:10:16.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphScatterNDOps.h	2022-02-17 16:57:21.000000000 -0500
@@ -233,6 +233,121 @@
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 @end
 
+@interface MPSGraph(MPSGraphScatterAlongAxisOps)
+
+/*!
+ *  @abstract   Create ScatterAlongAxis op and return the result tensor
+ *  @discussion Scatter values from `updatesTensor` along the specified `axis` at indices in `indicesTensor` into a result tensor.
+ *              Values are updated following `mode`. See MPSGraphScatterMode.
+ *              The shape of `updatesTensor` and `indicesTensor` must match. `shape` must match except at `axis`.
+ *              The shape of the result tensor is equal to `shape` and initialized with an initial value corresponding to `mode`.
+ *              If an index is out of bounds of `shape` along `axis` the update value is skipped.
+ *
+ *  @param      axis        The axis to scatter to. Negative values wrap around
+ *  @param      updatesTensor        The input tensor to scatter values from
+ *  @param      indicesTensor        Int32 or Int64 tensor used to index the result tensor
+ *  @param      mode        The type of update to use
+ *  @param      name        The name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object
+ */
+-(MPSGraphTensor *) scatterAlongAxis:(NSInteger) axis
+                   withUpdatesTensor:(MPSGraphTensor *) updatesTensor
+                       indicesTensor:(MPSGraphTensor *) indicesTensor
+                               shape:(MPSShape *) shape
+                                mode:(MPSGraphScatterMode) mode
+                                name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( scatterAlongAxis(_:updates:indices:shape:mode:name:) )
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
+/*!
+ *  @abstract   Create ScatterAlongAxis op and return the result tensor
+ *  @discussion See above discussion of scatterAlongAxis: withUpdatesTensor: indicesTensor: shape: mode: name:
+ *
+ *  @param      axisTensor        Scalar Int32 tensor. The axis to scatter to. Negative values wrap around
+ *  @param      updatesTensor        The input tensor to scatter values from
+ *  @param      indicesTensor        Int32 or Int64 tensor used to index the result tensor
+ *  @param      mode        The type of update to use
+ *  @param      name        The name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object
+ */
+-(MPSGraphTensor *) scatterAlongAxisTensor:(MPSGraphTensor *) axisTensor
+                         withUpdatesTensor:(MPSGraphTensor *) updatesTensor
+                             indicesTensor:(MPSGraphTensor *) indicesTensor
+                                     shape:(MPSShape *) shape
+                                      mode:(MPSGraphScatterMode) mode
+                                      name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( scatterAlongAxisTensor(_:updates:indices:shape:mode:name:) )
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
+/*!
+ *  @abstract   Create ScatterAlongAxis op and return the result tensor
+ *  @discussion Scatter values from `updatesTensor` along the specified `axis` at indices in `indicesTensor` onto `dataTensor`.
+ *              Values in `dataTensor` are updated following `mode`. See MPSGraphScatterMode.
+ *              The shape of `updatesTensor` and `indicesTensor` must match. The shape of `dataTensor` must match except at `axis`.
+ *              If an index is out of bounds of `shape` along `axis` the update value is skipped.
+ *
+ *              For example,
+ *              @code
+ *              data = [ [0, 0, 0],
+ *                       [1, 1, 1],
+ *                       [2, 2, 2],
+ *                       [3, 3, 3] ]
+ *              updates = [ [1, 2, 3],
+ *                          [4, 5, 6] ]
+ *              indices = [ [2, 1, 0],
+ *                          [1, 3, 2] ]
+ *              axis = 0
+ *              result = scatterAlongAxis(axis, data, updates, indices, MPSGraphScatterModeAdd, "scatter")
+ *              result = [ [0, 0, 3],
+ *                         [5, 3, 1],
+ *                         [3, 2, 8],
+ *                         [3, 8, 3] ]
+ *              @endcode
+ *
+ *  @param      axis        The axis to scatter to. Negative values wrap around
+ *  @param      dataTensor        The input tensor to scatter values onto
+ *  @param      updatesTensor        The input tensor to scatter values from
+ *  @param      indicesTensor        Int32 or Int64 tensor used to index the result tensor
+ *  @param      mode        The type of update to use
+ *  @param      name        The name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object
+ */
+-(MPSGraphTensor *) scatterAlongAxis:(NSInteger) axis
+                      withDataTensor:(MPSGraphTensor *) dataTensor
+                       updatesTensor:(MPSGraphTensor *) updatesTensor
+                       indicesTensor:(MPSGraphTensor *) indicesTensor
+                                mode:(MPSGraphScatterMode) mode
+                                name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( scatterAlongAxis(_:data:updates:indices:mode:name:) )
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
+/*!
+ *  @abstract   Create ScatterAlongAxis op and return the result tensor
+ *  @discussion See above discussion of scatterAlongAxis: withDataTensor: updatesTensor: indicesTensor: shape: mode: name:
+ *
+ *  @param      axisTensor        Scalar Int32 tensor. The axis to scatter to. Negative values wrap around
+ *  @param      dataTensor        The input tensor to scatter values onto
+ *  @param      updatesTensor        The input tensor to scatter values from
+ *  @param      indicesTensor        Int32 or Int64 tensor used to index the result tensor
+ *  @param      mode        The type of update to use
+ *  @param      name        The name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object
+ */
+-(MPSGraphTensor *) scatterAlongAxisTensor:(MPSGraphTensor *) axisTensor
+                            withDataTensor:(MPSGraphTensor *) dataTensor
+                             updatesTensor:(MPSGraphTensor *) updatesTensor
+                             indicesTensor:(MPSGraphTensor *) indicesTensor
+                                      mode:(MPSGraphScatterMode) mode
+                                      name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( scatterAlongAxisTensor(_:data:updates:indices:mode:name:) )
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
+
+@end
+
 NS_ASSUME_NONNULL_END
 
 #endif /* MPSScatterNDOps_h */
diff -ruN /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h
--- /Applications/Xcode_13.3.0-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h	2022-02-04 13:46:13.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h	2022-02-17 16:53:20.000000000 -0500
@@ -442,7 +442,7 @@
                             axis:(NSInteger) axis
                             name:(NSString * _Nullable) name
 MPS_SWIFT_NAME( stack(_:axis:name:) )
-MPS_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4));
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
 
 /*!
  *  @abstract   Create split op and return the result
@@ -461,7 +461,7 @@
                                       axis:(NSInteger) axis
                                       name:(NSString * _Nullable) name
 MPS_SWIFT_NAME( split(_:splitSizes:axis:name:) )
-MPS_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4));
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
 
 /*!
  *  @abstract   Create split op and return the result
@@ -480,7 +480,7 @@
                                       axis:(NSInteger) axis
                                       name:(NSString * _Nullable) name
 MPS_SWIFT_NAME( split(_:splitSizesTensor:axis:name:) )
-MPS_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4));
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
 
 /*!
  *  @abstract   Create split op and return the result
@@ -499,7 +499,7 @@
                                       axis:(NSInteger) axis
                                       name:(NSString * _Nullable) name
 MPS_SWIFT_NAME( split(_:numSplits:axis:name:) )
-MPS_AVAILABLE_STARTING(macos(12.4), ios(15.4), tvos(15.4));
+MPS_AVAILABLE_STARTING(macos(12.3), ios(15.4), tvos(15.4));
 
 /*!
  *  @abstract   Create squeeze op and return the result
Clone this wiki locally