Skip to content

Commit d8a8329

Browse files
committedNov 20, 2024
4: Extract the table into separate file to make docstrfmt happy
1 parent f515067 commit d8a8329

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed
 

‎content/4-gpu-concepts-table.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. table:: Software mapping naming
2+
:align: center
3+
4+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
5+
| CUDA | HIP | OpenCL | SYCL |
6+
+=========================+=========================+===========================+===================================================+
7+
| grid of threads | NDRange |
8+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
9+
| block | work-group |
10+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
11+
| warp | wavefront | sub-group |
12+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
13+
| thread | work-item |
14+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
15+
| registers | private memory |
16+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
17+
| shared memory | local data share | local memory |
18+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
19+
| threadIdx.\{x,y,z\} | get_local_id(\{0,1,2\}) | nd_item::get_local(\{2,1,0\}) [#syclindex]_ |
20+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
21+
| blockIdx.\{x,y,z\} | get_group_id(\{0,1,2\}) | nd_item::get_group(\{2,1,0\}) [#syclindex]_ |
22+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
23+
| blockDim.\{x,y,z\} | get_local_size(\{0,1,2\}) | nd_item::get_local_range(\{2,1,0\}) [#syclindex]_ |
24+
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
25+
26+
.. [#syclindex] In SYCL, the thread indexing is inverted. In a 3D grid, physically adjacent threads have consecutive X (0) index in CUDA, HIP, and OpenCL, but consecutive Z (2) index in SYCL.
27+
In a 2D grid, CUDA, HIP, and OpenCL still has contiguous indexing along X (0) dimension, while in SYCL it is Y (1).
28+
Same applies to block dimensions and indexing.
29+

‎content/4-gpu-concepts.rst

+1-31
Original file line numberDiff line numberDiff line change
@@ -236,37 +236,7 @@ Terminology
236236

237237
At the moment there are three major GPU producers: NVIDIA, Intel, and AMD. While the basic concept behind GPUs is pretty similar they use different names for the various parts. Furthermore there are software environments for GPU programming, some from the producers and some from external groups all having different naming as well. Below there is a short compilation of the some terms used across different platforms and software environments.
238238

239-
240-
.. table:: Software mapping naming
241-
:align: center
242-
243-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
244-
| CUDA | HIP | OpenCL | SYCL |
245-
+=========================+=========================+===========================+===================================================+
246-
| grid of threads | NDRange |
247-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
248-
| block | work-group |
249-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
250-
| warp | wavefront | sub-group |
251-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
252-
| thread | work-item |
253-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
254-
| registers | private memory |
255-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
256-
| shared memory | local data share | local memory |
257-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
258-
| threadIdx.\{x,y,z\} | get_local_id(\{0,1,2\}) | nd_item::get_local(\{2,1,0\}) [#syclindex]_ |
259-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
260-
| blockIdx.\{x,y,z\} | get_group_id(\{0,1,2\}) | nd_item::get_group(\{2,1,0\}) [#syclindex]_ |
261-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
262-
| blockDim.\{x,y,z\} | get_local_size(\{0,1,2\}) | nd_item::get_local_range(\{2,1,0\}) [#syclindex]_ |
263-
+-------------------------+-------------------------+---------------------------+---------------------------------------------------+
264-
265-
.. [#syclindex] In SYCL, the thread indexing is inverted. In a 3D grid, physically adjacent threads have consecutive X (0) index in CUDA, HIP, and OpenCL, but consecutive Z (2) index in SYCL.
266-
In a 2D grid, CUDA, HIP, and OpenCL still has contiguous indexing along X (0) dimension, while in SYCL it is Y (1).
267-
Same applies to block dimensions and indexing.
268-
269-
239+
.. include:: 4-gpu-concepts-table.rst
270240

271241
Exercises
272242
---------

0 commit comments

Comments
 (0)
Please sign in to comment.