Contents

setBuffer(_:offset:for:)

Sets the buffer and byte offset to use as backing storage for the given plane.

Declaration

func setBuffer(_ buffer: any MTLBuffer, offset: Int, for plane: MTLTensorPlaneType)

Parameters

  • buffer:

    The buffer to back the plane.

  • offset:

    The byte offset into the buffer.

  • plane:

    The plane type to associate the buffer with.

Discussion

The buffer must not be nil. The offset must be aligned to 128 bytes if the plane uses a format MTLTensorDataType, otherwise it must be aligned to the size of the plane’s data type in bytes.