Trap Control Flow
Abort execution and signal an exception/interrupt to the host.
Vendor-Neutral Definition
Immediately transfers control to a trap/exception handler (host-side interrupt for PTX; the wave's configured trap handler for AMDGPU), aborting normal execution.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler
translations.
equivalent with restrictions
Both abort normal execution and transfer control to an exception/interrupt handler.
| Property | NVIDIA PTX | AMDGPU |
|---|---|---|
| Instruction | trap | s_trap |
| ISA Layer | Virtual | Native |
| Data Types | - | - |
| Version / Target Introduced | PTX ISA 1.0 | gfx1100 |
Important Differences
- PTX's trap generates a host-CPU interrupt; AMDGPU's s_trap invokes the wave's own configured trap handler (set up by the runtime/driver), which is a GPU-resident routine, not a host-side interrupt - the two mechanisms serve the same abort-and-handle purpose within very different execution models.
Source Evidence
- Parallel Thread Execution ISA ↗ - NVIDIA Corporation
- "AMD Instinct MI300" Instruction Set Architecture: Reference Guide ↗ - Advanced Micro Devices, Inc.
Verification method: documentation