Table Comparing Syntax for Different Compute APIs#
Term |
CUDA |
HIP |
OpenCL |
---|---|---|---|
Device |
|
|
|
Queue |
|
|
|
Event |
|
|
|
Memory |
|
|
|
grid |
grid |
NDRange |
|
block |
block |
work-group |
|
thread |
thread |
work-item |
|
warp |
warp |
sub-group |
|
Thread- |
threadIdx.x |
threadIdx.x |
get_local_id(0) |
Block- |
blockIdx.x |
blockIdx.x |
get_group_id(0) |
Block- |
blockDim.x |
blockDim.x |
get_local_size(0) |
Grid-dim |
gridDim.x |
gridDim.x |
get_num_groups(0) |
Device Kernel |
|
|
|
Device Function |
|
|
Implied in device compilation |
Host Function |
|
|
Implied in host compilation |
Host + Device Function |
|
|
No equivalent |
Kernel Launch |
|
|
|
Global Memory |
|
|
|
Group Memory |
|
|
|
Constant |
|
|
|
|
|
|
|
Atomic Builtins |
|
|
|
Precise Math |
|
|
|
Fast Math |
|
|
|
Vector |
|
|
|
Notes#
The indexing functions (starting with thread-index
) show the terminology for a 1D grid. Some APIs use reverse order of xyz / 012 indexing for 3D grids.