PTX ISA v9.4

9.7.10.16. Data Movement and Conversion Instructions: prefetch, prefetchu

prefetch, prefetchu

Prefetch line containing a generic address at a specified level of memory hierarchy, in specified state space.

Syntax

ptx
prefetch{.space}.level                            [a];   // prefetch to data cache
prefetch{.global}.level::prefetch_size.valid_addr [a];   // prefetch to L1 data cache
prefetch.global.level::eviction_priority          [a];   // prefetch to data cache

prefetchu.L1  [a];             // prefetch to uniform cache

prefetch{.tensormap_space}.tensormap [a];  // prefetch the tensormap

.space =                    { .global, .local };
.level =                    { .L1, .L2 };
.level::prefetch_size =     { .L1::32B };
.level::eviction_priority = { .L2::evict_last, .L2::evict_normal };
.tensormap_space =          { .const, .param };

Description

The prefetch instruction brings the cache line containing the specified address in global or local memory state space into the specified cache level.

The optional qualifier .L1::32B can be specified to represent a valid prefetch of at least 32 byte. If specified, the instruction must satisfy the following conditions:

  • Qualifier .valid_addr must be specified; The .valid_addr qualifier requires at-least 1B-wide memory location referred to by address a to be valid for this access. Otherwise, the behavior is undefined.
  • Qualifier .space if specified, must be set to .global. If the address is not specified, generic addressing is used and the generic address must fall within the global state-space.

If the .tensormap qualifier is specified then the prefetch instruction brings the cache line containing the specified address in the .const or .param memory state space for subsequent use by the [cp.async.bulk.tensor](async-copy/cp-async-bulk-tensor.md) instruction.

If no state space is given, the prefetch uses Generic Addressing.

Optionally, the eviction priority to be applied on the prefetched cache line can be specified by the modifier .level::eviction_priority.

Supported addressing modes for operand a and alignment requirements are described in Addresses as Operands

The prefetchu instruction brings the cache line containing the specified generic address into the specified uniform cache level.

A prefetch to a shared memory location performs no operation.

A prefetch into the uniform cache requires a generic address, and no operation occurs if the address maps to a const, local, or shared memory location.

PTX ISA Notes

Introduced in PTX ISA version 2.0.

Support for .level::eviction_priority qualifier introduced in PTX ISA version 7.4.

Support for the .tensormap qualifier is introduced in PTX ISA version 8.0.

Support for .valid_addr and .L1::32B qualifiers introduced in PTX ISA version 9.4.

Target ISA Notes

prefetch and prefetchu require sm_20 or higher.

Support for .level::eviction_priority qualifier requires sm_80 or higher.

Support for the .tensormap qualifier requires sm_90 or higher.

Support for .valid_addr and .L1::32B qualifiers requires sm_90 or higher.

Examples

ptx
prefetch.global.L1                  [ptr];
prefetch.global.L1::32B.valid_addr  [ptr];
prefetch.global.L2::evict_last      [ptr];
prefetchu.L1  [addr];
prefetch.const.tensormap            [ptr];
esc
Type to search across all documentation