Skip to content

low.resource

low dialect

Import a function-local target resource into a low register value.

Operation contract

Property Value
Semantic phase executable
Traits Pure

Signature

Kind Name Type Cardinality Description
Operand extent_value register optional Optional dynamic byte-addressable extent guaranteed valid for the imported resource.
Result result register required
Attribute import_kind enum LowResourceImportKind required
Attribute index i64 required
Attribute source_type type required
Attribute extent i64 optional Optional static byte-addressable extent guaranteed valid for the imported resource.
Attribute cache_swizzle_stride i64 optional Optional byte stride that enables target resource-level cache swizzling.

Examples

%state = low.resource<vm_state> {index = 0, source_type = i64} : reg<vm.i64>
%binding = low.resource<hal_binding> {index = 0, source_type = hal.buffer} : reg<amdgpu.sgpr x2>
%dynamic = low.resource<hal_binding> extent(%extent) {index = 0, source_type = hal.buffer} : reg<amdgpu.sgpr x2>
%swizzled = low.resource<hal_binding> {index = 1, source_type = hal.buffer, cache_swizzle_stride = 64} : reg<amdgpu.sgpr x2>
%fixed = low.resource<command_input> {index = 0, source_type = buffer} : reg<cmd.buffer>