Skip to content

MetalPerformanceShadersGraph iOS xcode14.1 b1

Alex Soto edited this page Sep 15, 2022 · 1 revision

#MetalPerformanceShadersGraph.framework

diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h	2022-08-05 16:55:44.000000000 -0400
+++ /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraph.h	2022-09-09 11:37:26.000000000 -0400
@@ -91,8 +91,9 @@
 typedef void (^MPSGraphCompletionHandler)(MPSGraphTensorDataDictionary * resultsDictionary,
                                           NSError * _Nullable error);
 
-/*! @abstract   A notification when graph execution: has finished
+/*! @abstract   A notification when graph execution: has been scheduled
  *  @param      resultsDictionary  If no error, the results dictionary produced by the graph operation.
+ *                                If Graph has not yet allocated the results will be NSNull
  *  @param      error   If an error occurs, more information might be found here.
  */
 typedef void (^MPSGraphScheduledHandler)(MPSGraphTensorDataDictionary * resultsDictionary,
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h	2022-08-05 16:53:28.000000000 -0400
+++ /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphExecutable.h	2022-09-09 11:34:21.000000000 -0400
@@ -14,14 +14,14 @@
 NS_ASSUME_NONNULL_BEGIN
 
 /*! @abstract   A notification when graph executable execution: has finished
- *  @param      results  If no error, the results produced by the graph operation.
+ *  @param      results  If no error, the results produced by the graph operation. If Graph has not yet allocated the results this will be NSNull
  *  @param      error   If an error occurs, more information might be found here.
  */
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0))
 typedef void (^MPSGraphExecutableCompletionHandler)(NSArray<MPSGraphTensorData *> * results,
                                                     NSError * _Nullable error);
 
-/*! @abstract   A notification when graph executable execution: has finished
+/*! @abstract   A notification when graph executable execution: has been scheduled
  *  @param      results  If no error, the results produced by the graph operation.
  *  @param      error   If an error occurs, more information might be found here.
  */
@@ -124,7 +124,7 @@
 
 /*!
  *  @abstract   Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed.
- *              This call  is asynchronous and will return immediately if a completionHandler is set.
+ *              This call  is asynchronous and will return immediately.
  *
  *  @param      commandQueue                                      CommandQueue passed to exectute the graph on
  *  @param      inputsArray                                         Feeds tensorData for the placeholder tensors, same order as arguments of main function
@@ -141,7 +141,7 @@
 
 /*!
  *  @abstract   Runs the graph for given feeds to return targetTensor values, ensuring all target operations also executed.
- *              This call  is asynchronous and will return immediately if a completionHandler is set.
+ *              This call  is asynchronous and will return immediately after finishing encoding.
  *
  *  @param      commandBuffer                                     commandBuffer passed to exectute the graph on, commitAndContinue might be called, please don't rely on underlying MTLCommandBuffer to remain uncommitted
  *  @param      inputsArray                                         Feeds tensorData for the placeholder tensors, same order as arguments of main function
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphMatrixInverseOps.h	2022-09-09 11:37:26.000000000 -0400
@@ -0,0 +1,40 @@
+//
+//  MPSGraphInverseOps.h
+//  MPSGraph
+//
+//  Created on 8/2/22.
+//  Copyright © 2022 Apple Inc. All rights reserved.
+//
+
+#ifndef MPSGraphInverseOps_h
+#define MPSGraphInverseOps_h
+
+#import <MetalPerformanceShadersGraph/MPSGraph.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface MPSGraph(MPSGraphMatrixInverseOps)
+
+/*!
+ *  @abstract   Create  Matrix inverse op and return the result tensor
+ *  @discussion Find the inverse of a square matrix by calling LU decomposition and solver
+ *              The op computes inverse for all batches If the input tensor has more than
+ *              2 dimensions. Results are undefined for ill conditioned matrices.
+ *
+ *  @param      inputTensor          input tensor to inverse op
+ *  @param      name                          name for the operation
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *) inverseOfTensor:(MPSGraphTensor *) inputTensor
+                               name:(NSString * _Nullable) name
+MPS_SWIFT_NAME( inverse(input:name:) )
+MPS_CLASS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1));
+
+@end
+
+
+NS_ASSUME_NONNULL_END
+
+
+#endif /* MPSGraphInverseOps_h */
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h	2022-08-05 16:55:44.000000000 -0400
+++ /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MPSGraphTensorShapeOps.h	2022-09-09 11:34:22.000000000 -0400
@@ -245,16 +245,38 @@
                                             rightPadding:(MPSShape *) rightPadding
                                                     name:(NSString * _Nullable) name;
 
+/*!
+ *  @abstract   Create space-to-depth2d op and return the result tensor
+ *  @discussion This operation outputs a copy of the `input` tensor, where values from the
+ *              `widthAxis` and `heightAxis` dimensions are moved in spatial blocks of size
+ *              `blockSize` to the `depthAxis` dimension. `usePixelShuffleOrder` can be
+ *              used to control how the data within spatial blocks is ordered in the
+ *              `depthAxis` dimension: with `usePixelShuffleOrder=YES` the values within the
+ *              spatial blocks are stored contiguosly within the `depthAxis` dimension whereas
+ *              otherwise they are stored interleaved with existing values in the `depthAxis`
+ *              dimension.
+ *              This operation is the inverse of `depthToSpace2D`.
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      widthAxis                               Axis that defines the fastest running dimension within the block.
+ *  @param      heightAxis                             Axis that defines the 2nd fastest running dimension within the block.
+ *  @param      depthAxis                               Axis that defines the destination dimension, where to copy the blocks.
+ *  @param      blockSize                               Size of the square spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the depth dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object
+ */
 -(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
-                        widthAxisTensor:(MPSGraphTensor *) widthAxisTensor
-                       heightAxisTensor:(MPSGraphTensor *) heightAxisTensor
-                        depthAxisTensor:(MPSGraphTensor *) depthAxisTensor
-                              blockSize:(NSUInteger)blockSize
+                              widthAxis:(NSUInteger) widthAxis
+                             heightAxis:(NSUInteger) heightAxis
+                              depthAxis:(NSUInteger) depthAxis
+                              blockSize:(NSUInteger) blockSize
                    usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
                                    name:(NSString * _Nullable) name
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
--(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
+-(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
                         widthAxisTensor:(MPSGraphTensor *) widthAxisTensor
                        heightAxisTensor:(MPSGraphTensor *) heightAxisTensor
                         depthAxisTensor:(MPSGraphTensor *) depthAxisTensor
@@ -263,7 +285,29 @@
                                    name:(NSString * _Nullable) name
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
--(MPSGraphTensor *)spaceToDepth2DTensor:(MPSGraphTensor *) tensor
+/*!
+ *  @abstract   Create depth-to-space2d op and return the result tensor
+ *  @discussion This operation outputs a copy of the input tensor, where values from the
+ *              `depthAxis` dimension are moved in spatial blocks of size `blockSize` to the
+ *              `heightAxis` and `widthAxis` dimensions. `usePixelShuffleOrder` can be
+ *              used to control how the data within spatial blocks is ordered in the
+ *              `depthAxis` dimension: with `usePixelShuffleOrder = YES` the values within the
+ *              spatial block are stored contiguosly within the `depthAxis` dimension whereas
+ *              without it they are stored interleaved with existing values in the `depthAxisTensor`
+ *              dimension.
+ *              This operation is the inverse of `spaceToDepth2D`
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      widthAxis                               Axis that defines the fastest running dimension within the block.
+ *  @param      heightAxis                             Axis that defines the 2nd fastest running dimension within the block.
+ *  @param      depthAxis                               Axis that defines the source dimension, from which to copy the blocks.
+ *  @param      blockSize                               Size of the square spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the depth dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
                               widthAxis:(NSUInteger) widthAxis
                              heightAxis:(NSUInteger) heightAxis
                               depthAxis:(NSUInteger) depthAxis
@@ -273,15 +317,97 @@
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
 -(MPSGraphTensor *)depthToSpace2DTensor:(MPSGraphTensor *) tensor
-                              widthAxis:(NSUInteger) widthAxis
-                             heightAxis:(NSUInteger) heightAxis
-                              depthAxis:(NSUInteger) depthAxis
+                        widthAxisTensor:(MPSGraphTensor *) widthAxisTensor
+                       heightAxisTensor:(MPSGraphTensor *) heightAxisTensor
+                        depthAxisTensor:(MPSGraphTensor *) depthAxisTensor
                               blockSize:(NSUInteger)blockSize
                    usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
                                    name:(NSString * _Nullable) name
 MPS_AVAILABLE_STARTING(macos(12.0), ios(15.0), tvos(15.0));
 
 /*!
+ *  @abstract   Create space-to-batch op and return the result tensor.
+ *  @discussion This operation outputs a copy of the `input` tensor, where values from the
+ *              `spatialAxes` (for `usePixelShuffleOrder=YES`1,2 or 3 axes supported, otherwise
+ *              limited only by MPSNDArray rank limitations) dimensions are moved in spatial blocks with
+ *              rectangular size defined by `blockDimensions` to the `batchAxis` dimension.
+ *              `usePixelShuffleOrder` can be used to control how the data within spatial blocks is ordered
+ *              in the `batchAxis` dimension: with `usePixelShuffleOrder=YES` the values within the
+ *              spatial blocks are stored contiguosly within the `batchAxis` dimension whereas
+ *              otherwise they are stored interleaved with existing values in the `batchAxis`
+ *              dimension.
+ *              Note: This operation is the inverse of `batchToSpace`.
+ *              Note: This operation is a generalization of `depthToSpace2D`.
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      spatialAxes                           Axes that define the dimensions containing the spatial blocks.
+ *  @param      batchAxis                               Axis that defines the destination dimension, where to copy the blocks.
+ *  @param      blockDimensions                  Defines the size of the rectangular spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the batch dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *)spaceToBatchTensor:(MPSGraphTensor *) tensor
+                          spatialAxes:(NSArray<NSNumber *> *) spatialAxes
+                            batchAxis:(NSInteger) batchAxis
+                      blockDimensions:(NSArray<NSNumber *> *) blockDimensions
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( spaceToBatch(_:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:));
+
+-(MPSGraphTensor *)spaceToBatchTensor:(MPSGraphTensor *) tensor
+                    spatialAxesTensor:(MPSGraphTensor *) spatialAxesTensor
+                      batchAxisTensor:(MPSGraphTensor *) batchAxisTensor
+                blockDimensionsTensor:(MPSGraphTensor *) blockDimensionsTensor
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( spaceToBatch(_:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:));
+
+/*!
+ *  @abstract   Create a batch-to-space3d op and return the result tensor.
+ *  @discussion This operation outputs a copy of the input tensor, where values from the
+ *              `batchAxis` dimension are moved in spatial blocks of size `blockDimensions` to the
+ *              `spatialAxes` dimensions (for `usePixelShuffleOrder=YES`1,2 or 3 axes supported,
+ *              otherwise limited only by MPSNDArray rank limitations). `usePixelShuffleOrder`
+ *              can be used to control how the data within spatial blocks is ordered in the
+ *              `batchAxis` dimension: with `usePixelShuffleOrder = YES` the values within the
+ *              spatial block are stored contiguosly within the `batchAxis` dimension whereas
+ *              without it they are stored interleaved with existing values in the `batchAxis`
+ *              dimension.
+ *              Note: This operation is the inverse of `spaceToBatch`.
+ *              Note: This operation is a generalization of `depthToSpace2D`.
+ *
+ *  @param      tensor                                      The input tensor.
+ *  @param      spatialAxes                           Axes that define the dimensions containing the spatial blocks.
+ *  @param      batchAxis                               Axis that defines the source dimension, from which to copy the blocks.
+ *  @param      blockDimensions                  Defines the size of the rectangular spatial sub-block.
+ *  @param      usePixelShuffleOrder       Controls layout of the sub-blocks within the batch dimension.
+ *  @param      name                                           The name for the operation.
+ *
+ *  @return     A valid MPSGraphTensor object.
+ */
+-(MPSGraphTensor *)batchToSpaceTensor:(MPSGraphTensor *) tensor
+                          spatialAxes:(NSArray<NSNumber *> *) spatialAxes
+                            batchAxis:(NSInteger) batchAxis
+                      blockDimensions:(NSArray<NSNumber *> *) blockDimensions
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( batchToSpace(_:spatialAxes:batchAxis:blockDimensions:usePixelShuffleOrder:name:));
+
+-(MPSGraphTensor *)batchToSpaceTensor:(MPSGraphTensor *) tensor
+                    spatialAxesTensor:(MPSGraphTensor *) spatialAxesTensor
+                      batchAxisTensor:(MPSGraphTensor *) batchAxisTensor
+                blockDimensionsTensor:(MPSGraphTensor *) blockDimensionsTensor
+                 usePixelShuffleOrder:(BOOL)usePixelShuffleOrder
+                                 name:(NSString * _Nullable) name
+MPS_AVAILABLE_STARTING(macos(13.0), ios(16.1), tvos(16.1))
+MPS_SWIFT_NAME( batchToSpace(_:spatialAxesTensor:batchAxisTensor:blockDimensionsTensor:usePixelShuffleOrder:name:));
+
+/*!
  *  @abstract   Create reverse op and return the result tensor
  *  @discussion Reverses a tensor on given axes
  *              https://www.tensorflow.org/api_docs/python/tf/reverse.
diff -ruN /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MetalPerformanceShadersGraph.h /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MetalPerformanceShadersGraph.h
--- /Applications/Xcode_14.0.0-beta6.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MetalPerformanceShadersGraph.h	2022-08-01 11:54:29.000000000 -0400
+++ /Applications/Xcode_14.1.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/MetalPerformanceShadersGraph.framework/Headers/MetalPerformanceShadersGraph.h	2022-09-05 23:50:13.000000000 -0400
@@ -20,8 +20,8 @@
 #import <MetalPerformanceShadersGraph/MPSGraphGatherOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphLinearAlgebraOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphLossOps.h>
+#import <MetalPerformanceShadersGraph/MPSGraphMatrixInverseOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphMatrixMultiplicationOps.h>
-#import <MetalPerformanceShadersGraph/MPSGraphSparseOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphMemoryOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphNormalizationOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphOneHotOps.h>
@@ -33,6 +33,7 @@
 #import <MetalPerformanceShadersGraph/MPSGraphRNNOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphScatterNDOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphSortOps.h>
+#import <MetalPerformanceShadersGraph/MPSGraphSparseOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphStencilOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphTensorShapeOps.h>
 #import <MetalPerformanceShadersGraph/MPSGraphTopKOps.h>
Clone this wiki locally