Skip to content

Metal macOS xcode26.4 b3

Alex Soto edited this page Mar 11, 2026 · 1 revision

#Metal.framework

diff -ruN /Applications/Xcode_26.4.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h /Applications/Xcode_26.4.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h
--- /Applications/Xcode_26.4.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h	2026-02-16 03:13:25
+++ /Applications/Xcode_26.4.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h	2026-03-02 13:00:13
@@ -67,17 +67,19 @@
 
 /// Creates a tensor that shares storage with this buffer.
 ///
+/// `offset` must be 0 when ``MTLTensorDescriptor/usage`` contains ``MTLTensorUsage/MTLTensorUsageMachineLearning``.
+///
+/// When ``MTLTensorDescriptor/dataType`` is a sub-byte ``MTLTensorDataType``, `offset` must be aligned to 128 bytes.
+/// Although only required for sub-byte types, applying 128-byte alignment for all ``MTLTensorDataType``
+/// values improves performance.
+///
+/// See ``MTLTensorDescriptor`` for more information.
+///
 /// - Parameters:
 ///   - descriptor: A description of the properties for the new tensor.
 ///   - offset: Offset into the buffer at which the data of the tensor begins.
 ///   - error: If an error occurs during creation, Metal populates this parameter to provide you information about it.
-///
-/// If the descriptor specifies `MTLTensorUsageMachineLearning` usage, you need to observe the following restrictions:
-/// * pass in `0` for the `offset` parameter
-/// * set the element stride the descriptor to `1`
-/// * ensure that number of bytes per row is a multiple of `64`
-/// * for dimensions greater than `2`, make sure `strides[dim] = strides[dim -1] * dimensions[dim - 1]`
-///
+/// - Returns: The created ``MTLTensor`` instance, or `nil` if the function failed.
 - (nullable id <MTLTensor>)newTensorWithDescriptor:(MTLTensorDescriptor *)descriptor
                                             offset:(NSUInteger)offset
                                              error:(__autoreleasing NSError * _Nullable * _Nullable)error API_AVAILABLE(macos(26.0), ios(26.0));
diff -ruN /Applications/Xcode_26.4.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h /Applications/Xcode_26.4.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h
--- /Applications/Xcode_26.4.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h	2026-02-16 03:00:56
+++ /Applications/Xcode_26.4.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h	2026-03-01 02:04:08
@@ -110,11 +110,12 @@
 
 /// An array of strides, in elements, one for each dimension in the tensors you create with this descriptor, if applicable.
 ///
-/// This property only applies to tensors you create from a buffer, otherwise it is nil. You are responsible for ensuring `strides` meets the following requirements:
-/// - Elements of `strides`are in monotonically non-decreasing order.
+/// You are responsible for ensuring `strides` meets the following requirements:
 /// - The first element of `strides` is one.
-/// - For any `i` larger than zero, `strides[i]` is greater than or equal to `strides[i-1] * dimensions[i-1]`.
-/// - If `usage` contains ``MTLTensorUsage/MTLTensorUsageMachineLearning``, the second element of `strides` is aligned to 64 bytes, and for any `i` larger than one, `strides[i]` is equal to `strides[i-1] * dimensions[i-1]`.
+/// - If ``usage`` contains ``MTLTensorUsage/MTLTensorUsageMachineLearning``, the second element of `strides` is aligned to 64 bytes, and for any `i` larger than one, `strides[i]` is equal to `strides[i-1] * dimensions[i-1]`.
+/// - If ``dataType`` is a sub-byte ``MTLTensorDataType``, for any `i` greater than or equal to 1, `strides[i]` is aligned to 128 bytes. This is not a requirement for non-sub-byte data types, but following this convention improves performance.
+///
+/// Only set this property when creating tensors from a buffer.
 @property (readwrite, nonatomic, copy, nullable) MTLTensorExtents *strides;
 
 /// A data format for the tensors you create with this descriptor.
diff -ruN /Applications/Xcode_26.4.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes /Applications/Xcode_26.4.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes
--- /Applications/Xcode_26.4.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes	2026-02-12 10:23:01
+++ /Applications/Xcode_26.4.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Metal.framework/Headers/Metal.apinotes	2026-02-26 20:00:33
@@ -417,6 +417,8 @@
   SwiftName: uint16
 - Name: MTLTensorDataTypeUInt32
   SwiftName: uint32
+- Name: MTLTensorDataTypeUInt4
+  SwiftName: uint4
 
 Classes:
 - Name: MTLCaptureManager

Clone this wiki locally