pub struct RawBufferLoadOperation<'c> { /* private fields */ }
Expand description
A raw_buffer_load
operation. Raw Buffer load, exposing GCN features.
The amdgpu.raw_buffer_load
op is a wrapper around the buffer load intrinsics
available on AMD GPUs, including extensions in newer GPUs.
The index into the buffer is computed as for memref.load
with the additon
of indexOffset
and sgprOffset
(which may or may not be considered
in bounds checks and includes any offset present on the memref type if it’s
non-zero).
All indices and offsets are in units of the memref’s data type and are converted to bytes during lowering.
When a load is out of bounds, the instruction returns zero.
Partially-out of bounds have chipset-dependent behavior: whether reading
2 elements starting at index 7 of a memref<8xf32>
returns the last element
in the first vector component depends on the architecture.
The memref struct is converted into a buffer resource (a V#) and the arguments are translated to intrinsic arguments as follows:
- The base address of the buffer is the base address of the memref
- The stride is 0 to enable raw mode
- The number of records is the size of the memref, in bytes In the case of dynamically-shaped memrefs, this is computed at runtime as max_d (size(d) * stride(d)) * sizeof(elementType(memref))
- The offset enable bit is 1, the index enable bit is 0.
- The thread ID addition bit is off
- If
boundsCheck
is false and the target chipset is RDNA, OOB_SELECT is set to 2 to disable bounds checks, otherwise it is 3 - The cache coherency bits are off
Implementations§
source§impl<'c> RawBufferLoadOperation<'c>
impl<'c> RawBufferLoadOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> RawBufferLoadOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> RawBufferLoadOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.