Device/Api-agnostic description of the logical parallelism exposed to a kernel.
More...
Device/Api-agnostic description of the logical parallelism exposed to a kernel.
A frame specification describes how a multidimensional index range [0; K) is divided into fixed-size chunks, called frames (NF), each with a frame extent (FE), where K = NF * FE. K does not need to match the problem size (P), e.g., the number of elements in a buffer you want to process in a kernel. Often, the best performance of a kernel can be achieved if K <= P, and if the kernel uses SIMD operations, K <= P/(SIMD width). alpaka derives the onHost::ThreadSpec to launch the kernel, based on a heuristic and additional launch information from the FrameSpec. Therefore a kernel enqueued with a frame specification should always be written to be executable with any onHost::ThreadSpec and should not depend on hard-coded thread numbers, to ensure portability between devices.
A FrameSpec is therefore not equivalent to a CUDA-style grid description. It specifies only the maximum parallelism made available to the kernel. It does not guarantee the number of physical thread blocks, nor the number of physical threads per block used by the backend. If exact control over blocks and threads is required, use onHost::ThreadSpec.
- Template Parameters
-
| T_NumFrames | The n-dimensional number of frames. |
| T_FrameExtents | The n-dimensional size of one logical frame. |
| T_Executor | The executor used to translate the onHost::ThreadSpec into a thread block hierarchy. If the executor is exec::AnyExecutor alpaka will select a good fitting executor for the action where the ThreadSpec is used. |
Definition at line 45 of file FrameSpec.hpp.