
Contents
Compute APIs: CUDA, HIP, OpenCL.
| Term | CUDA | HIP | OpenCL |
|---|---|---|---|
| Device | int deviceId | int deviceId | cl_device |
| Queue | cudaStream_t | hipStream_t | cl_command_queue |
| Event | cudaEvent_t | hipEvent_t | cl_event |
| Memory | void * | void * | cl_mem |
| grid | grid | NDRange | |
| block | block | work-group | |
| thread | thread | work-item | |
| warp | warp | sub-group | |
| Grid dim | gridDim.x | hipGridDim_x | get_global_size(0) |
| Block dim | blockDim.x | hipBlockDim_x | get_local_size(0) |
| Block index | blockIdx.x | hipBlockIdx_x | get_group_id(0) |
| Thread index | threadIdx.x | hipThreadIdx_x | get_local_id(0) |
| Device Function | __device__ | __device__ | In device Compilation |
| Host Function | __host__ | __host__ | In host Compilation |
| Host + Device Function | __device__ __host__ | __device__ __host__ | No |
| Kernel Launch | <<< >>> | hipLaunchKernel | clEnqueueNDRangeKernel |
| Global Memory | __global__ | __global__ | __global |
| Group Memory | __shared__ | __shared__ | __local |
| Constant | __constant__ | __constant__ | __constant |




近期评论