dp4a GPU Virtual ISA NVIDIA
dp4a Integer Arithmetic Instructions
dp4a.atype.btype d, a, b, c;
Four-way byte dot product which is accumulated in 32-bit result.
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 |
|---|---|---|---|---|---|
| dp4a.atype.btype d, a, b, c; | sm_61 | Four-way byte dot product which is accumulated in 32-bit result. Operand a and b are 32-bit inputs which hold 4 byte inputs in packed form for dot product. Operand c has type.u32 if both.atype and. (see the official PTX ISA docs for the full description) |
Operands
-
d
Destination register -
a
Source operand -
b
Source operand -
c
Source operand
At a Glance
Related AMDGPU Concepts
4-Way Dot Product (Accumulate) ↗
equivalent with restrictions
v_dot4_i32_i8
(AMDGPU)
v_dot4_u32_u8
(AMDGPU)
Related
More in Integer Arithmetic Instructions
Reference
NVIDIA PTX ISA
Description
Four-way byte dot product which is accumulated in 32-bit result.
Operand a and b are 32-bit inputs which hold 4 byte inputs in packed form for dot product.
Operand c has type.u32 if both.atype and.btype are.u32 else operand c has type.s32.
Semantics
d = c;
// Extract 4 bytes from a 32bit input and sign or zero extend
// based on input type.
Va = extractAndSignOrZeroExt_4(a, .atype);
Vb = extractAndSignOrZeroExt_4(b, .btype);
for (i = 0; i < 4; ++i) {
d += Va[i] * Vb[i];
}
Examples
dp4a.u32.u32 d0, a0, b0, c0;
dp4a.u32.s32 d1, a1, b1, c1;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.