prefetch GPU Virtual ISA NVIDIA

Data Movement and Conversion Instructions

prefetch{.space}.level [a]; // prefetch to data cache

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

Encoding

PTX is a virtual instruction set. It has no single, stable native binary encoding - the compiler lowers this instruction to different native machine code depending on the selected NVIDIA target architecture (compute capability). This page intentionally shows no bit-diagram; see the target/version requirements below for what governs how this instruction compiles.
PTX ISA Version Introduced PTX ISA 2.0
Minimum Target sm_20

Syntax Forms

One mnemonic covers many type / state-space / scope / modifier combinations - each row below is an independently valid form.

Syntax Data Types State Space(s) Modifiers Min. Target Description
prefetch{.space}.level [a]; // prefetch to data cache sm_20 The prefetch instruction brings the cache line containing the specified address in global or local memory state space into the specified cache level. If the. (see the official PTX ISA docs for the full description)

Operands

At a Glance

Data Types -

Related AMDGPU Concepts

Cache Prefetch ↗
equivalent with restrictions
flat_prefetch_b8 (AMDGPU)

Reference

NVIDIA PTX ISA

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 space is not specified, generic addressing is used and the generic address must fall within the global state-space. (see the official PTX ISA docs for the full description)

Examples

prefetch.global.L1                  [ptr];
prefetch.global.L1::32B.valid_addr  [ptr];
prefetch.global.L2::evict_last      [ptr];
prefetchu.L1  [addr];
prefetch.const.tensormap            [ptr];

Reproduced from NVIDIA's official PTX ISA documentation for technical accuracy.

Sources