alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::api::util Namespace Reference

Functions

template<std::integral auto T_limit, std::integral auto T_index, std::integral auto T_increment>
consteval auto adjustToLimit (concepts::CVector auto const input)
 adjust the input vector to a given limit by halving all components until the product of these is below or equal to the limit
auto adjustToLimit (concepts::Vector auto input, std::integral auto const limit)
 adjust the input vector to a given limit by halving the largest dimension until the product of all components is below or equal to the limit
template<typename T_ValueType, alpaka::concepts::Vector T_Extents>
auto emulatedAlignedMemDescription (uint32_t alignmentInByte, T_Extents extents)
 provides a memory description to create multidimensional linewise aligned memory within a one dimensional byte area
consteval uint32_t highestPowerOfTwo (uint32_t value)
template<typename T_ValueType>
constexpr auto simdOptimizedAlignment (auto api, alpaka::concepts::DeviceKind auto deviceKind)
 Calculate the best alignment for SIMD optimized memory allocation.

Function Documentation

◆ adjustToLimit() [1/2]

template<std::integral auto T_limit, std::integral auto T_index, std::integral auto T_increment>
auto alpaka::api::util::adjustToLimit ( concepts::CVector auto const input)
consteval

adjust the input vector to a given limit by halving all components until the product of these is below or equal to the limit

Definition at line 64 of file util.hpp.

◆ adjustToLimit() [2/2]

auto alpaka::api::util::adjustToLimit ( concepts::Vector auto input,
std::integral auto const limit )
inline

adjust the input vector to a given limit by halving the largest dimension until the product of all components is below or equal to the limit

Definition at line 71 of file util.hpp.

◆ emulatedAlignedMemDescription()

template<typename T_ValueType, alpaka::concepts::Vector T_Extents>
auto alpaka::api::util::emulatedAlignedMemDescription ( uint32_t alignmentInByte,
T_Extents extents )
inline

provides a memory description to create multidimensional linewise aligned memory within a one dimensional byte area

Parameters
alignmentdata alignment in bytes
Returns
tuple with the linearized data blob size in bytes and multi-dimensional pitches, std::tuple(numBytes,pitchMD)

Definition at line 101 of file util.hpp.

◆ highestPowerOfTwo()

uint32_t alpaka::api::util::highestPowerOfTwo ( uint32_t value)
consteval

Definition at line 124 of file util.hpp.

◆ simdOptimizedAlignment()

template<typename T_ValueType>
auto alpaka::api::util::simdOptimizedAlignment ( auto api,
alpaka::concepts::DeviceKind auto deviceKind )
inlineconstexpr

Calculate the best alignment for SIMD optimized memory allocation.

Parameters
apithe API to use
deviceKindthe device kind to use
Returns
the best alignment in bytes, will be a power of two value

Definition at line 141 of file util.hpp.