Skip to content

MPSCore macOS xcode15.0 b1

Alex Soto edited this page Jun 5, 2023 · 1 revision

#MPSCore.framework

diff -ruN /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSCoreTypes.h /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSCoreTypes.h
--- /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSCoreTypes.h	2023-03-09 23:49:40
+++ /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSCoreTypes.h	2023-05-31 05:09:55
@@ -204,6 +204,35 @@
 #endif
 ;
 
+#if defined(DOXYGEN)
+    typedef enum MPSFloatDataTypeBit
+#else
+    typedef NS_ENUM(uint32_t, MPSFloatDataTypeBit)
+#endif
+{
+    MPSFloatDataTypeSignBit = 0x00800000,     // 1 bit of sign
+    MPSFloatDataTypeExponentBit = 0x007C0000, // 5 bits of exponent
+    MPSFloatDataTypeMantissaBit = 0x0003FC00, // 8 bits of mantissa
+}
+#if defined(DOXYGEN)
+MPSFloatDataTypeBit
+#endif
+    ;
+
+#if defined(DOXYGEN)
+    typedef enum MPSFloatDataTypeShift
+#else
+    typedef NS_ENUM(uint32_t, MPSFloatDataTypeShift)
+#endif
+{
+    MPSFloatDataTypeSignShift = 23,     // 1 bit of sign
+    MPSFloatDataTypeExponentShift = 18, // 5 bits of exponent
+    MPSFloatDataTypeMantissaShift = 10, // 8 bits of mantissa
+}
+#if defined(DOXYGEN)
+MPSFloatDataTypeShift
+#endif
+    ;
     
 /*! @enum        MPSDataType
  *  @discussion A value to specify a type of data.
@@ -216,6 +245,7 @@
  *
  *  @constant   MPSDataTypeFloat32      32-bit floating point (single-precision).
  *  @constant   MPSDataTypeFloat16      16-bit floating point (half-precision).  (IEEE-754-2008 float16 exchange format)
+ *  @constant   MPSDataTypeBFloat16    16-bit brain floating point (1 sign bit, 8 exponent bits, 7 mantissa bits)
  *  @constant   MPSDataTypeInt8         Signed 8-bit integer.
  *  @constant   MPSDataTypeInt16        Signed 16-bit integer.
  *  @constant   MPSDataTypeUInt8        Unsigned 8-bit integer. Not normalized
@@ -235,8 +265,8 @@
     MPSDataTypeInvalid MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(10.0), macCatalyst(13.0), tvos(10.0)) MPS_SWIFT_NAME(invalid) = 0,
     
     MPSDataTypeFloatBit MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(10.0), macCatalyst(13.0), tvos(10.0)) = 0x10000000,
-    MPSDataTypeFloat32  MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(10.0), macCatalyst(13.0), tvos(10.0)) = MPSDataTypeFloatBit | 32,
-    MPSDataTypeFloat16  MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(11.0), macCatalyst(13.0), tvos(11.0)) = MPSDataTypeFloatBit | 16,
+    MPSDataTypeFloat32 MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(10.0), macCatalyst(13.0), tvos(10.0)) = MPSDataTypeFloatBit | 32,
+    MPSDataTypeFloat16 MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(10.0), macCatalyst(13.0), tvos(10.0)) = MPSDataTypeFloatBit | 16,
 
     MPSDataTypeComplexBit MPS_ENUM_AVAILABLE_STARTING( macos(13.1), ios(16.2), macCatalyst(16.2), tvos(16.2)) = 0x01000000,
     MPSDataTypeComplexFloat32  MPS_ENUM_AVAILABLE_STARTING( macos(13.1), ios(16.2), macCatalyst(16.2), tvos(13.1)) = MPSDataTypeFloatBit | MPSDataTypeComplexBit | 64,
@@ -256,8 +286,9 @@
     MPSDataTypeUInt32  MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(10.0), macCatalyst(13.0), tvos(10.0))   = 32,
     MPSDataTypeUInt64  MPS_ENUM_AVAILABLE_STARTING( macos(11.0), ios(14.1), macCatalyst(14.1), tvos(14.1))    = 64,
 
-    MPSDataTypeAlternateEncodingBit MPS_ENUM_AVAILABLE_STARTING( macos(12.0), ios(15.0), tvos(15.0))                       = 0x80000000,
-    MPSDataTypeBool                 MPS_ENUM_AVAILABLE_STARTING( macos(12.0), ios(15.0), tvos(15.0))                       = MPSDataTypeAlternateEncodingBit | 8,
+    MPSDataTypeAlternateEncodingBit MPS_ENUM_AVAILABLE_STARTING( macos(12.0), ios(15.0), tvos(15.0))         = 0x80000000,
+    MPSDataTypeBool                 MPS_ENUM_AVAILABLE_STARTING( macos(12.0), ios(15.0), tvos(15.0))         = MPSDataTypeAlternateEncodingBit | 8,
+    MPSDataTypeBFloat16 MPS_ENUM_AVAILABLE_STARTING( macos(14.0), ios(16.0), tvos(16.0))                     = MPSDataTypeAlternateEncodingBit | MPSDataTypeFloat16,
 
     // unsigned normalized  (see for example Metal's unorm8 and unorm16 pixel formats). Range: [0, 1.0]
     MPSDataTypeNormalizedBit MPS_ENUM_AVAILABLE_STARTING( macos(10.13), ios(11.0), macCatalyst(13.0), tvos(11.0))   = 0x40000000,
diff -ruN /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSFunctionConstantIndices.h /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSFunctionConstantIndices.h
--- /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSFunctionConstantIndices.h	2023-03-08 00:58:57
+++ /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSFunctionConstantIndices.h	2023-05-31 08:48:48
@@ -9,17 +9,18 @@
 #ifndef MPSFunctionConstantIndices_h
 #define MPSFunctionConstantIndices_h
 
-#define MPSDeviceCapsIndex                            127                     // unavailable to user
-#define MPSFunctionConstantIndex                      (MPSDeviceCapsIndex-1)  // unavailable to user
-#define MPSBatchSizeIndex                             (MPSDeviceCapsIndex-2)  // unavailable to user
-#define MPSUserConstantIndex                          (MPSDeviceCapsIndex-3)  // unavailable to user
-#define MPSNDArrayConstantIndex                       (MPSDeviceCapsIndex-4)  // unavailable to user
-#define MPSFunctionConstantIndexReserved              (MPSDeviceCapsIndex-5)  // unavailable to user
-#define MPSTextureLinkingConstantIndex                (MPSDeviceCapsIndex-6)  // unavailable to user
-#define MPSNDArrayConstantMultiDestIndex              (MPSDeviceCapsIndex-7)  // unavailable to user
-#define MPSNDArrayConstantMultiDestSrcAddressingIndex (MPSDeviceCapsIndex-8)  // unavailable to user
-#define MPSNDArrayConstantMultiDestDstAddressingIndex (MPSDeviceCapsIndex-9)  // unavailable to user
-#define MPSUserAvailableFunctionConstantStartIndex    (MPSDeviceCapsIndex-10)  // first index availble to user
-
+#define MPSDeviceCapsIndex                             127                     // unavailable to user
+#define MPSFunctionConstantIndex                       (MPSDeviceCapsIndex-1)  // unavailable to user
+#define MPSBatchSizeIndex                              (MPSDeviceCapsIndex-2)  // unavailable to user
+#define MPSUserConstantIndex                           (MPSDeviceCapsIndex-3)  // unavailable to user
+#define MPSNDArrayConstantIndex                        (MPSDeviceCapsIndex-4)  // unavailable to user
+#define MPSFunctionConstantIndexReserved               (MPSDeviceCapsIndex-5)  // unavailable to user
+#define MPSTextureLinkingConstantIndex                 (MPSDeviceCapsIndex-6)  // unavailable to user
+#define MPSNDArrayConstantMultiDestIndex               (MPSDeviceCapsIndex-7)  // unavailable to user
+#define MPSNDArrayConstantMultiDestIndex0              (MPSDeviceCapsIndex-8)  // unavailable to user
+#define MPSNDArrayConstantMultiDestIndex1              (MPSDeviceCapsIndex-9)  // unavailable to user
+#define MPSNDArrayConstantMultiDestSrcAddressingIndex  (MPSDeviceCapsIndex-10)  // unavailable to user
+#define MPSNDArrayConstantMultiDestDstAddressingIndex  (MPSDeviceCapsIndex-11)  // unavailable to user
+#define MPSUserAvailableFunctionConstantStartIndex     (MPSDeviceCapsIndex-12)  // first index availble to user
 
 #endif /* MPSFunctionConstantIndices_h */
diff -ruN /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSKernelTypes.h /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSKernelTypes.h
--- /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSKernelTypes.h	2023-03-08 00:58:57
+++ /Applications/Xcode_15.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Headers/MPSKernelTypes.h	2023-05-31 05:09:51
@@ -30,7 +30,8 @@
     MPSDeviceSupportsFloat16BicubicFiltering    = 1 << 9,
     MPSDeviceIsAppleDevice                      = 1 << 10,
     MPSDeviceSupportsSimdShuffleAndFill         = 1 << 11,
-    MPSDeviceCapsLast                           = 1 << 12,
+    MPSDeviceSupportsBFloat16Arithmetic         = 1 << 12,
+    MPSDeviceCapsLast                           = 1 << 13,
     
 } MPSDeviceCapsValues;
 
@@ -51,6 +52,7 @@
 constant bool kMPSDeviceIsAppleDevice  = (kMPSDeviceCaps & MPSDeviceIsAppleDevice)  != 0;
 constant bool kMPSDeviceSupportsNorm16BicubicFiltering = (kMPSDeviceCaps & MPSDeviceSupportsNorm16BicubicFiltering) != 0;
 constant bool kMPSDeviceSupportsFloat16BicubicFiltering = (kMPSDeviceCaps & MPSDeviceSupportsFloat16BicubicFiltering) != 0;
+constant bool kMPSDeviceSupportsBFloat16Arithmetic = (kMPSDeviceCaps & MPSDeviceSupportsBFloat16Arithmetic) != 0;
 
 
 #endif
@@ -742,6 +744,7 @@
 typedef int64_t  MPSFunctionConstant;
 typedef uint32_t MPSFunctionConstantInMetal;
 static const MPSFunctionConstant    MPSFunctionConstantNone = -1LL;
+static const MPSFunctionConstant    MPSFunctionConstantNoneArray[2] = {-1LL, -1LL};
 
 #   ifdef __cplusplus
 static inline MPSFunctionConstant MPSMakeFunctionConstant( MPSImageType destType,
Clone this wiki locally