alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor > Struct Template Reference

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

Detailed Description

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
struct alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >

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_NumFramesThe n-dimensional number of frames.
T_FrameExtentsThe n-dimensional size of one logical frame.
T_ExecutorThe 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.

Member Typedef Documentation

◆ FrameExtentsVecType

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
using alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::FrameExtentsVecType = T_FrameExtents

Definition at line 50 of file FrameSpec.hpp.

◆ index_type

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
using alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::index_type = typename T_NumFrames::type

Definition at line 47 of file FrameSpec.hpp.

◆ NumFramesVecType

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
using alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::NumFramesVecType = T_NumFrames

Definition at line 49 of file FrameSpec.hpp.

Constructor & Destructor Documentation

◆ FrameSpec()

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::FrameSpec ( T_NumFrames const & numFrames,
T_FrameExtents const & frameExtent,
T_Executor executor = T_Executor{} )
inlineconstexpr

Definition at line 57 of file FrameSpec.hpp.

Member Function Documentation

◆ dim()

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
consteval uint32_t alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::dim ( )
inlinestaticnodiscardconsteval

Definition at line 82 of file FrameSpec.hpp.

◆ getExecutor()

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
constexpr T_Executor alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::getExecutor ( )
inlinestaticnodiscardconstexprnoexcept

Definition at line 67 of file FrameSpec.hpp.

◆ getFrameExtents()

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
FrameExtentsVecType const & alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::getFrameExtents ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 77 of file FrameSpec.hpp.

◆ getNumFrames()

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
NumFramesVecType const & alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::getNumFrames ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 72 of file FrameSpec.hpp.

Member Data Documentation

◆ m_frameExtents

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
FrameExtentsVecType alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::m_frameExtents
private

Definition at line 54 of file FrameSpec.hpp.

◆ m_numFrames

template<alpaka::concepts::Vector T_NumFrames, alpaka::concepts::Vector< typename T_NumFrames::type, T_NumFrames::dim()> T_FrameExtents, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
NumFramesVecType alpaka::onHost::FrameSpec< T_NumFrames, T_FrameExtents, T_Executor >::m_numFrames
private

Definition at line 53 of file FrameSpec.hpp.


The documentation for this struct was generated from the following file: