call GPU Virtual ISA NVIDIA
call Control Flow Instructions
// direct call to named function, func is a symbol
call{.uni} (ret-param), func, (param-list);
call{.uni} (ret-param), func, (param-list);
The call instruction stores the address of the next instruction, so execution can resume at that point after executing a ret instruction.
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.
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 |
|---|---|---|---|---|---|
| // direct call to named function, func is a symbol call{.uni} (ret-param), func, (param-list); | sm_20 | The call instruction stores the address of the next instruction, so execution can resume at that point after executing a ret instruction. (see the official PTX ISA docs for the full description) |
Operands
Reference
NVIDIA PTX ISA
Description
The call instruction stores the address of the next instruction, so execution can resume at that
point after executing a ret instruction. A call is assumed to be divergent unless the.uni suffix is present. The.uni suffix indicates that the call is guaranteed to be
non-divergent, i.e. all active threads in a warp that are currently executing this instruction have
identical values for the guard predicate and call target.
For direct calls, the called location func must be a symbolic function name; for indirect calls,
the called location fptr must be an address of a function held in a register. Input arguments
and return values are optional. (see the official PTX ISA docs for the full description)
Examples
// examples of direct call
call init; // call function 'init'
call.uni g, (a); // call function 'g' with parameter 'a'
@p call (d), h, (a, b); // return value into register d
// call-via-pointer using jump table
// (truncated - see the official PTX ISA docs for the full example)Reproduced from NVIDIA's official PTX ISA documentation for technical accuracy.
Sources
-
Parallel Thread Execution ISA ↗
- NVIDIA Corporation, Chapter 9 - Instruction Set
Deep-linked directly to this instruction's section.