alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor > Struct Template Reference

Backend-specific description of the actual block and thread launch shape. More...

#include <ThreadSpec.hpp>

Public Types

using index_type = typename T_NumBlocks::type
using NumBlocksVecType = typename T_NumBlocks::UniVec
using NumThreadsVecType = T_NumThreads

Public Member Functions

constexpr ThreadSpec (T_NumBlocks const &numBlocks, T_NumThreads const &numThreadsPerBlock, T_Executor executor=T_Executor{})
constexpr NumBlocksVecType const & getNumBlocks () const noexcept
constexpr NumThreadsVecType const & getNumThreads () const noexcept

Static Public Member Functions

static consteval uint32_t dim ()
static constexpr T_Executor getExecutor ()

Private Attributes

NumBlocksVecType m_numBlocks
NumThreadsVecType m_numThreads

Detailed Description

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
struct alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >

Backend-specific description of the actual block and thread launch shape.

A thread specification directly describes the number of blocks and the number of threads per block that are passed to the backend. This is the closest alpaka equivalent to a CUDA grid/block launch configuration.

In contrast to alpaka::onHost::FrameSpec, a ThreadSpec is not a logical frame decomposition. It is used when a kernel requires exact guarantees about the number of blocks and the size of each block.

Template Parameters
T_ExecutorIf the executor is alpaka::exec::AnyExecutor alpaka will select a good fitting executor for the action where the ThreadSpec is used.

Definition at line 32 of file ThreadSpec.hpp.

Member Typedef Documentation

◆ index_type

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
using alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::index_type = typename T_NumBlocks::type

Definition at line 34 of file ThreadSpec.hpp.

◆ NumBlocksVecType

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
using alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::NumBlocksVecType = typename T_NumBlocks::UniVec

Definition at line 35 of file ThreadSpec.hpp.

◆ NumThreadsVecType

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
using alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::NumThreadsVecType = T_NumThreads

Definition at line 36 of file ThreadSpec.hpp.

Constructor & Destructor Documentation

◆ ThreadSpec()

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::ThreadSpec ( T_NumBlocks const & numBlocks,
T_NumThreads const & numThreadsPerBlock,
T_Executor executor = T_Executor{} )
inlineconstexpr

Definition at line 43 of file ThreadSpec.hpp.

Member Function Documentation

◆ dim()

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
consteval uint32_t alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::dim ( )
inlinestaticnodiscardconsteval

Definition at line 68 of file ThreadSpec.hpp.

◆ getExecutor()

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
constexpr T_Executor alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::getExecutor ( )
inlinestaticnodiscardconstexpr

Definition at line 53 of file ThreadSpec.hpp.

◆ getNumBlocks()

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
NumBlocksVecType const & alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::getNumBlocks ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 63 of file ThreadSpec.hpp.

◆ getNumThreads()

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
NumThreadsVecType const & alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::getNumThreads ( ) const
inlinenodiscardconstexprnoexcept

Definition at line 58 of file ThreadSpec.hpp.

Member Data Documentation

◆ m_numBlocks

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
NumBlocksVecType alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::m_numBlocks
private

Definition at line 39 of file ThreadSpec.hpp.

◆ m_numThreads

template<alpaka::concepts::Vector T_NumBlocks, alpaka::concepts::Vector< typename T_NumBlocks::type, T_NumBlocks::dim()> T_NumThreads, alpaka::concepts::Executor T_Executor = alpaka::exec::AnyExecutor>
NumThreadsVecType alpaka::onHost::ThreadSpec< T_NumBlocks, T_NumThreads, T_Executor >::m_numThreads
private

Definition at line 40 of file ThreadSpec.hpp.


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