![]() |
alpaka
Abstraction Library for Parallel Kernel Acceleration
|
Device/Api-agnostic description of the logical parallelism exposed to a kernel. More...
#include <FrameSpec.hpp>
Public Types | |
| using | FrameExtentsVecType = T_FrameExtents |
| using | index_type = typename T_NumFrames::type |
| using | NumFramesVecType = T_NumFrames |
Public Member Functions | |
| constexpr | FrameSpec (T_NumFrames const &numFrames, T_FrameExtents const &frameExtent, T_Executor executor=T_Executor{}) |
| constexpr FrameExtentsVecType const & | getFrameExtents () const noexcept |
| constexpr NumFramesVecType const & | getNumFrames () const noexcept |
Static Public Member Functions | |
| static consteval uint32_t | dim () |
| static constexpr T_Executor | getExecutor () noexcept |
Private Attributes | |
| FrameExtentsVecType | m_frameExtents |
| NumFramesVecType | m_numFrames |
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.
| 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.
| using alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::FrameExtentsVecType = T_FrameExtents |
Definition at line 50 of file FrameSpec.hpp.
| using alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::index_type = typename T_NumFrames::type |
Definition at line 47 of file FrameSpec.hpp.
| using alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::NumFramesVecType = T_NumFrames |
Definition at line 49 of file FrameSpec.hpp.
|
inlineconstexpr |
Definition at line 57 of file FrameSpec.hpp.
|
inlinestaticnodiscardconsteval |
Definition at line 82 of file FrameSpec.hpp.
|
inlinestaticnodiscardconstexprnoexcept |
Definition at line 67 of file FrameSpec.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 77 of file FrameSpec.hpp.
|
inlinenodiscardconstexprnoexcept |
Definition at line 72 of file FrameSpec.hpp.
|
private |
Definition at line 54 of file FrameSpec.hpp.
|
private |
Definition at line 53 of file FrameSpec.hpp.