Skip to content

Commit 5b2564e

Browse files
committed
Add kernel discussion
1 parent cde8f54 commit 5b2564e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/glossary.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ Conceptually, all of the threads in a dispatch are executed in parallel, though
6464

6565
A dispatch gets access to its input and output buffers through a descriptor set.
6666

67+
### Compute shader vs kernel
68+
69+
The distinction between compute shader and kernel is blurry, and Metal especially splits the difference by using the term "kernel" for its compute shader capability. Generally a compute shader integrates seamlessly with other graphics rendering primitives, while OpenCL and CUDA kernels require their own separate runtime (possibly with interop features). Tools like [clvk] also blur the distinction, by providing a layer to run OpenCL-compatible kernels on compute shader infrastructure.
70+
71+
Further confusing the issue is the fact that SPIR-V exists in two flavors, one for OpenCL kernels and one for (compute) shaders; these are distinguished by the "Execution Model" field in the SPIR-V header. In the kernel execution model, pointers are enabled by default, while in compute shaders they are extensions.
72+
6773
### Command buffer (Vulkan, Metal, WebGPU); Command list (DX12)
6874

6975
A command buffer is a sequence of commands, of which the main substance is compute dispatches, but there are a bunch of other commands required to glue these together: pipeline barriers (see below), buffer copies, etc.
@@ -213,4 +219,5 @@ Resources:
213219
[Single Instruction Multiple Threads]: https://en.wikipedia.org/wiki/Single_instruction,_multiple_threads
214220
[ISPC]: https://ispc.github.io/
215221
[Vulkan Memory Types on PC and How to Use Them]: https://asawicki.info/news_1740_vulkan_memory_types_on_pc_and_how_to_use_them
216-
[System and driver support for Resizable BAR]: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/resizable-bar-support
222+
[System and driver support for Resizable BAR]: https://docs.microsoft.com/en-us/windows-hardware/drivers/display/resizable-bar-support
223+
[clvk]: https://github.com/kpet/clvk

0 commit comments

Comments
 (0)