1) Should tensor strides be passed in elements or in bytes?
RESOLVED: Strides are passed in bytes but are required to be a
multiple of the tensor element size. Passing strides in bytes makes it
possible to relax this requirement in the future without an interface
change. It also makes it easier to describe memory alignment
requirements.
2) Should there be commands to copy data between tensors and
buffers/images?
RESOLVED: Adding these commands would result in a rather large API
surface and not insignificant implementation and validation cost. The
same outcome can be achieved with memory aliasing and tensor to tensor
copy operations.
3) Should this extension define transpose and/or other data
reorganization operations?
RESOLVED: These operations are useful to expose but this extension
is only meant to add base support for tensors. Additional operations
should be layered on top and defined in other extensions.
4) Why are tensor strides described using signed integers?
RESOLVED: Negative strides make it possible to describe different
linear data layouts. While this extension does not allow negative
strides, it uses signed integers for strides to make it possible to
relax this limitation in future extensions.
Version History
Revision 2, 2026-01-07 (Kévin Petit)
Add interactions with VK_KHR_unified_image_layouts,
VK_KHR_shader_bfloat16, and VK_EXT_shader_float8
To ensure that destroyTensorARM is always called: pass
bracket (or the allocate function from your
favourite resource management library) as the last argument.
To just extract the pair pass (,) as the last argument.
vkCreateTensorViewARM - Create an tensor view from an existing tensor
Description
Some of the tensor creation parameters are inherited by the view. In
particular, other than format, the tensor view creation inherits all
other parameters from the tensor.
The remaining parameters are contained in pCreateInfo.
To ensure that destroyTensorViewARM is always called: pass
bracket (or the allocate function from your
favourite resource management library) as the last argument.
To just extract the pair pass (,) as the last argument.
VkTensorDescriptionARM - Structure describing a tensor
Description
When describing a tensor created with TENSOR_TILING_OPTIMAL_ARM,
pStrides must be equal to NULL. When describing a tensor created
with TENSOR_TILING_LINEAR_ARM, pStrides is either an array of size
dimensionCount or NULL.
Each element in the pStrides array describes the offset in bytes
between increments of the given dimension. For example, pStrides[0]
describes the offset between element [x0,x1,x2,x3] and element
[x0+1,x1,x2,x3]. The pStrides array can be used to determine whether
a tensor is packed or not. If pStrides[dimensionCount-1] is equal
to the size of a tensor element and for each dimension n greater than
0 and less than dimensionCount, pStrides[n-1] is equal to
pStrides[n] * pDimensions[n], then the tensor is a packed tensor. If
the
tensorNonPacked
feature is not enabled, the tensor must be a packed tensor.
When a tensor is created with TENSOR_TILING_LINEAR_ARM and pStrides
equal to NULL the tensor strides are calculated by the vulkan
implementation such that the resulting tensor is a packed tensor.
Expressed as an addressing formula, the starting byte of an element in a
4-dimensional, for example, linear tensor has address:
// Assume (x0,x1,x2,x3) are in units of elements.
address(x0,x1,x2,x3) = x0*pStrides[0] + x1*pStrides[1] + x2*pStrides[2] + x3*pStrides[3]
pStrides[0] ×
pDimensions[0] must be less than or equal to
::maxTensorSize
For each i greater than
0, pStrides[i-1] must be greater than or equal to pStrides[i]
× pDimensions[i] so that no two elements of the tensor reference
the same memory address
VkTensorViewCreateInfoARM - Structure specifying parameters of a newly
created tensor view
Description
If tensor was created with the TENSOR_CREATE_MUTABLE_FORMAT_BIT_ARM
flag, formatcan be different from the tensor’s format, but if they
are not equal they must be compatible. Tensor format compatibility
is defined in the
Format Compatibility Classes
section. Views of compatible formats will have the same mapping between
element locations irrespective of the format, with only the
interpretation of the bit pattern changing.
Values intended to be used with one view format may not be exactly
preserved when written or read through a different format. For example,
an integer value that happens to have the bit pattern of a
floating-point denorm or NaN may be flushed or canonicalized when
written or read through a view with a floating-point format. Similarly,
a value written through a signed normalized format that has a bit
pattern exactly equal to -2b may be changed to -2b + 1 as described in
Conversion from Normalized Fixed-Point to Floating-Point.
VkBindTensorMemoryInfoARM - Structure specifying how to bind a tensor to
memory
Valid Usage
tensormust not
already be backed by a memory object
memoryOffsetmust be less than the size of memory
memorymust have
been allocated using one of the memory types allowed in the
memoryTypeBits member of the
MemoryRequirements structure
returned from a call to getTensorMemoryRequirementsARM with
tensor
memoryOffset is the start offset of the region of memory which is to
be bound to the tensor. The number of bytes returned in the
MemoryRequirements::size member in
memory, starting from memoryOffset bytes, will be bound to the
specified tensor.
Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
maxTensorElements is the maximum number of
data elements in a created tensor as specified in the
TensorDescriptionARM of TensorCreateInfoARM. The number of data
elements in a tensor is computed as the product of pDimensions[i] for
all 0 ≤ i ≤ dimensionCount-1.
maxTensorShaderAccessSize is the
maximum size in bytes of the data that can be read from a tensor with
OpTensorReadARM or written to a tensor with OpTensorWriteARM.
maxDescriptorSetStorageTensors
is the maximum number of tensors that can be included in descriptor
bindings in a pipeline layout across all pipeline shader stages and
descriptor set numbers. Descriptors with a type of
DESCRIPTOR_TYPE_TENSOR_ARM count
against this limit.
maxPerStageDescriptorSetStorageTensors is the maximum number of
tensors that can be accessible to a single shader stage in a pipeline
layout. Descriptors with a type of
DESCRIPTOR_TYPE_TENSOR_ARM count
against this limit. A descriptor is accessible to a pipeline shader
stage when the stageFlags member of the
DescriptorSetLayoutBinding structure has
the bit for that shader stage set.
maxDescriptorSetUpdateAfterBindStorageTensors is similar to
maxDescriptorSetStorageTensors but counts descriptors from descriptor
sets created with or without the
DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
bit set.
maxPerStageDescriptorUpdateAfterBindStorageTensors is similar to
maxPerStageDescriptorSetStorageTensors but counts descriptors from
descriptor sets created with or without the
DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT
bit set.
shaderStorageTensorArrayNonUniformIndexingNative is a boolean value
indicating whether storage tensor descriptors natively support
nonuniform indexing. If this is FALSE,
then a single dynamic instance of an instruction that nonuniformly
indexes an array of storage buffers may execute multiple times in order
to access all the descriptors.
shaderTensorSupportedStages is a
bitfield of
ShaderStageFlagBits describing
the shader stages that can access tensor resources.
shaderTensorSupportedStages will have the
SHADER_STAGE_COMPUTE_BIT bit
set if any of the physical device’s queues support
QUEUE_COMPUTE_BIT.
Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
VkTensorMemoryBarrierARM - Structure specifying a tensor memory barrier
Description
The first
synchronization scope
and
access scope
described by this structure include only operations and memory accesses
specified by srcStageMask and srcAccessMask.
The second
synchronization scope
and
access scope
described by this structure include only operations and memory accesses
specified by dstStageMask and dstAccessMask.
Both
access scopes
are limited to only memory accesses to tensor.
If tensor was created with
SHARING_MODE_EXCLUSIVE, and
srcQueueFamilyIndex is not equal to dstQueueFamilyIndex, this memory
barrier defines a
queue family transfer operation.
When executed on a queue in the family identified by
srcQueueFamilyIndex, this barrier defines a
queue family release operation
for the specified tensor, and the second synchronization and access
scopes do not synchronize operations on that queue. When executed on a
queue in the family identified by dstQueueFamilyIndex, this barrier
defines a
queue family acquire operation
for the specified tensor, and the first synchronization and access
scopes do not synchronize operations on that queue.
If tensor was created
with a sharing mode of
SHARING_MODE_EXCLUSIVE, and
srcQueueFamilyIndex and dstQueueFamilyIndex are not
QUEUE_FAMILY_IGNORED, at least one of
them must be the same as the family of the queue that will execute
this barrier
If tensor is
non-sparse then it must be bound completely and contiguously to a
single DeviceMemory object
shaderStorageTensorArrayNonUniformIndexing indicates whether arrays of
storage tensors can be indexed by non-uniform integer expressions in
shader code. If this feature is not enabled, resources with a descriptor
type of DESCRIPTOR_TYPE_TENSOR_ARMmust not be indexed by non-uniform integer expressions when aggregated
into arrays in shader code. This also indicates whether shader modules
can declare the StorageTensorArrayNonUniformIndexingARM capability.
descriptorBindingStorageTensorUpdateAfterBind indicates whether the
implementation supports updating storage tensor descriptors after a set
is bound. If this feature is not enabled,
DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BITmust not be used with
DESCRIPTOR_TYPE_TENSOR_ARM.
VkCopyTensorInfoARM - Structure specifying an tensor copy operation
Description
Each region in pRegions describes a region to be copied from the
source tensor to a corresponding region of the destination tensor.
srcTensor and dstTensorcan be the same tensor or alias the same
memory.
The formats of srcTensor and dstTensormust be compatible. Formats
are compatible if they share the same class, as shown in the
Compatible Formats
table.
cmdCopyTensorARM allows copying between size-compatible internal
formats.
Valid Usage
srcTensor and
dstTensormust have been created with equal values for
TensorDescriptionARM::dimensionCount
For each of the
elements of TensorDescriptionARM::pDimensions, srcTensor and
dstTensormust be the same size
regionCount must be
equal to 1
Each element of pRegionsmust be a TensorCopyARM structure whose pSrcOffset is NULL
or has all its elements equal to 0
Each element of pRegionsmust be a TensorCopyARM structure whose pDstOffset is NULL
or has all its elements equal to 0
Each element of pRegionsmust be a TensorCopyARM structure whose pExtent is NULL or
equal to the TensorDescriptionARM::pDimensions array specified
when srcTensor and dstTensor were created
Each element of pRegionsmust be a TensorCopyARM structure whose dimensionCount, if it
is not equal to 0, is equal to the largest of the
TensorDescriptionARM::dimensionCount of srcTensor or
dstTensor
pSrcOffset is NULL or an array of size dimensionCount providing an
offset into the source tensor. When pSrcOffset is NULL, the offset
into the source tensor is 0 in all dimensions.
pDstOffset is NULL or an array of size dimensionCount providing an
offset into the destination tensor. When pDstOffset is NULL, the
offset into the destination tensor is 0 in all dimensions.
pExtent is NULL or an array of size dimensionCount providing the
number of elements to copy in each dimension. When pExtent is NULL,
the number of elements to copy is taken as the total number of elements
in each dimension of the source tensor.
Instances4Show, FromCStruct, ToCStruct, Zero
ShowTensorCopyARMDefined in vulkan-3.27 · Vulkan.Extensions.VK_ARM_tensors
If
MemoryAllocateInfo defines a memory import
operation with handle type
EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
the memory being imported must also be a dedicated tensor
allocation and tensormust be identical to the tensor associated
with the imported memory
VkPhysicalDeviceDescriptorBufferTensorFeaturesARM - Structure describing
the descriptor buffer tensor features that can be supported by an
implementation
externalMemoryProperties is a
ExternalMemoryProperties
structure specifying various capabilities of the external handle type
when used with the specified tensor creation parameters.
VkExternalMemoryTensorCreateInfoARM - Specify that a tensor may be
backed by external memory
Members
A ExternalMemoryTensorCreateInfoARM structure with a non-zero
handleTypes field must be included in the creation parameters for a
tensor that will be bound to memory that is either exported or imported.
VkTensorTilingARM - Specifies the tiling arrangement of data in an
tensor
Description
TENSOR_TILING_OPTIMAL_ARM specifies optimal tiling (elements are
laid out in an implementation-dependent arrangement, for more
efficient memory access).
TENSOR_TILING_LINEAR_ARM specifies linear tiling (elements are
laid out linearly and the offset between each element is determined
by the
strides
of the tensor).