Skip to content

MPSNDArray macOS xcode27.0 b1

Alex Soto edited this page Jun 9, 2026 · 1 revision

#MPSNDArray.framework

diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayIdentity.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayIdentity.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayIdentity.h	2026-04-18 19:39:03
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayIdentity.h	2026-05-24 03:49:34
@@ -94,6 +94,50 @@
                                      dimensionSizes: (NSUInteger*__nonnull) dimensionSizes
                                    destinationArray: (MPSNDArray * __nullable) destinationArray;
 
+/*! @abstract   Do a reshape operation on the CPU.
+ *  @param      sourceArray         The source NDArray.
+ *  @param      shape               The new shape in Tensorflow dimension order.
+ *  @result     A new array view of `sourceArray` is returned. Or `nil` If aliasing is not possible.
+ *   */
+-(nullable MPSNDArray *) reshapeWithSourceArray: (nonnull MPSNDArray *) sourceArray
+                                          shape: (nonnull MPSShape *) shape
+MPS_AVAILABLE_STARTING(macos(27.0), ios(27.0), tvos(27.0));
+
+#if !TARGET_IPHONE_SIMULATOR
+
+/*! @abstract   Encode a reshape operation.
+ *              The encoder associates the commands with MTLStageDispatch. Synchronize your
+ *              workloads against this stage when using this function to prevent race conditions.
+ *  @param      encoder          The MTL4ComputeCommandEncoder to encode the kernel with.
+ *  @param      sourceArray      The source NDArray.
+ *  @param      shape            The new shape in Tensorflow dimension order.
+ *  @param      destinationArray The destination NDArray. The shape of `destinationArray` must match `shape`.
+ *   */
+-(void) reshapeWithMTL4CommandEncoder: (nonnull id <MTL4ComputeCommandEncoder>) encoder
+                          sourceArray: (nonnull MPSNDArray *) sourceArray
+                                shape: (nonnull MPSShape *) shape
+                     destinationArray: (nonnull MPSNDArray *) destinationArray
+MPS_AVAILABLE_STARTING(macos(27.0), ios(27.0), tvos(27.0));
+
+/*! @abstract   Encode a reshape operation.
+ *              The encoder associates the commands with MTLStageDispatch. Synchronize your
+ *              workloads against this stage when using this function to prevent race conditions.
+ *  @param      encoder            The MTL4ComputeCommandEncoder to encode the kernel with.
+ *  @param      sourceArray        The source NDArray.
+ *  @param      numberOfDimensions The NDArray's dimension count.
+ *  @param      dimensionSizes     The extents of each dimension of the NDArray.
+ *  @param      destinationArray   The destination NDArray. The shape of `destinationArray` must match `numberOfDimensions`
+                                   and `dimensionSizes`.
+ *   */
+-(void) reshapeWithMTL4CommandEncoder: (nonnull id <MTL4ComputeCommandEncoder>) encoder
+                          sourceArray: (nonnull MPSNDArray *) sourceArray
+                       dimensionCount: (NSUInteger) numberOfDimensions
+                       dimensionSizes: (nonnull NSUInteger *) dimensionSizes
+                     destinationArray: (nonnull MPSNDArray *) destinationArray
+MPS_AVAILABLE_STARTING(macos(27.0), ios(27.0), tvos(27.0));
+
+#endif
+
 @end    // MPSNDArrayIdentity
 
 #endif /* MPSNDArrayIdentity_h */
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayKernel.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayKernel.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayKernel.h	2026-04-18 19:39:03
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNDArray.framework/Headers/MPSNDArrayKernel.h	2026-05-23 02:53:04
@@ -176,6 +176,23 @@
               destinationArray: (nonnull MPSNDArray *) destination
 MPS_AVAILABLE_STARTING(macos(15.0), ios(18.0), macCatalyst(18.0), tvos(18.0), visionos(2.0));
 
+#if !TARGET_IPHONE_SIMULATOR
+
+/*! @abstract   Encode a simple inference NDArray kernel.
+ *              The encoder associates the commands with MTLStageDispatch. Synchronize your
+ *              workloads against this stage when using this function to prevent race conditions.
+ *  @param      encoder      The MTL4ComputeCommandEncoder to encode the kernel with.
+ *  @param      sourceArrays The source NDArray instances in a NSArray. Make sure the instances
+ *                           are arranged in the order required by the MPSNDArrayMultiaryKernel
+ *                           subclass.
+ *  @param      destination  The destination NDArray. */
+-(void) encodeWithMTL4CommandEncoder: (nonnull id <MTL4ComputeCommandEncoder>) encoder
+                        sourceArrays: (nonnull NSArray <MPSNDArray *> *) sourceArrays
+                    destinationArray: (nonnull MPSNDArray *) destination
+MPS_AVAILABLE_STARTING(macos(27.0), ios(27.0), tvos(27.0));
+
+#endif
+
 @end
 
 
@@ -318,6 +335,21 @@
                   sourceArray: (MPSNDArray *__nonnull) sourceArray
                   resultState: (MPSState * __nullable) outGradientState
              destinationArray: (MPSNDArray * __nonnull) destination;
+
+#if !TARGET_IPHONE_SIMULATOR
+
+/*! @abstract   Encode a simple inference NDArray kernel.
+ *              The encoder associates the commands with MTLStageDispatch. Synchronize your
+ *              workloads against this stage when using this function to prevent race conditions.
+ *  @param      encoder     The MTL4ComputeCommandEncoder to encode the kernel with.
+ *  @param      sourceArray The source NDArray.
+ *  @param      destination The destination NDArray. */
+-(void) encodeWithMTL4CommandEncoder: (nonnull id <MTL4ComputeCommandEncoder>) encoder
+                         sourceArray: (nonnull MPSNDArray *) sourceArray
+                    destinationArray: (nonnull MPSNDArray *) destination
+MPS_AVAILABLE_STARTING(macos(27.0), ios(27.0), tvos(27.0));
+
+#endif
 
 @end
 

Clone this wiki locally