alpaka
Abstraction Library for Parallel Kernel Acceleration
WorkDivHelpers.hpp File Reference
#include "alpaka/acc/Traits.hpp"
#include "alpaka/core/Assert.hpp"
#include "alpaka/core/Common.hpp"
#include "alpaka/core/Utility.hpp"
#include "alpaka/dev/Traits.hpp"
#include "alpaka/extent/Traits.hpp"
#include "alpaka/kernel/KernelFunctionAttributes.hpp"
#include "alpaka/kernel/Traits.hpp"
#include "alpaka/vec/Vec.hpp"
#include "alpaka/workdiv/WorkDivMembers.hpp"
#include <algorithm>
#include <array>
#include <cmath>
#include <functional>
#include <set>
#include <type_traits>

Go to the source code of this file.

Classes

struct  alpaka::KernelCfg< TAcc, TGridElemExtent, TThreadElemExtent >
 Kernel start configuration to determine a valid work division. More...
 

Namespaces

 alpaka
 The alpaka accelerator library.
 
 alpaka::detail
 

Enumerations

enum class  alpaka::GridBlockExtentSubDivRestrictions {
  alpaka::EqualExtent ,
  alpaka::CloseToEqualExtent ,
  alpaka::Unrestricted
}
 The grid block extent subdivision restrictions. More...
 

Functions

template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
ALPAKA_FN_HOST auto alpaka::detail::allDivisorsLessOrEqual (T const &val, T const &maxDivisor) -> std::set< T >
 
template<typename TAcc , typename TDev , typename TGridElemExtent , typename TThreadElemExtent , typename TKernelFnObj , typename... TArgs>
ALPAKA_FN_HOST auto alpaka::getValidWorkDiv (KernelCfg< TAcc, TGridElemExtent, TThreadElemExtent > const &kernelCfg, [[maybe_unused]] TDev const &dev, TKernelFnObj const &kernelFnObj, TArgs &&... args) -> WorkDivMembers< Dim< TAcc >, Idx< TAcc >>
 
template<typename TDim , typename TIdx >
ALPAKA_FN_HOST auto alpaka::isValidAccDevProps (AccDevProps< TDim, TIdx > const &accDevProps) -> bool
 
template<typename TWorkDiv , typename TDim , typename TIdx >
ALPAKA_FN_HOST auto alpaka::isValidWorkDiv (TWorkDiv const &workDiv, AccDevProps< TDim, TIdx > const &accDevProps) -> bool
 Checks if the work division is supported. More...
 
template<typename TAcc , typename TWorkDiv , typename TDim , typename TIdx >
ALPAKA_FN_HOST auto alpaka::isValidWorkDiv (TWorkDiv const &workDiv, AccDevProps< TDim, TIdx > const &accDevProps, KernelFunctionAttributes const &kernelFunctionAttributes) -> bool
 Checks if the work division is supported. More...
 
template<typename TAcc , typename TWorkDiv , typename TDev >
ALPAKA_FN_HOST auto alpaka::isValidWorkDiv (TWorkDiv const &workDiv, TDev const &dev) -> bool
 Checks if the work division is supported by the device. More...
 
template<typename TAcc , typename TWorkDiv , typename TDev , typename TKernelFnObj , typename... TArgs>
ALPAKA_FN_HOST auto alpaka::isValidWorkDiv (TWorkDiv const &workDiv, TDev const &dev, TKernelFnObj const &kernelFnObj, TArgs &&... args) -> bool
 Checks if the work division is supported for the kernel on the device. More...
 
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
ALPAKA_FN_HOST auto alpaka::detail::nextDivisorLowerOrEqual (T const &dividend, T const &maxDivisor) -> T
 Finds the largest divisor where divident % divisor == 0. More...
 
template<typename TDim , typename TIdx >
ALPAKA_FN_HOST auto alpaka::subDivideGridElems (Vec< TDim, TIdx > const &gridElemExtent, Vec< TDim, TIdx > const &threadElemExtent, AccDevProps< TDim, TIdx > const &accDevProps, TIdx kernelBlockThreadCountMax=static_cast< TIdx >(0u), bool blockThreadMustDivideGridThreadExtent=true, GridBlockExtentSubDivRestrictions gridBlockExtentSubDivRestrictions=GridBlockExtentSubDivRestrictions::Unrestricted) -> WorkDivMembers< TDim, TIdx >
 Subdivides the given grid thread extent into blocks restricted by the maxima allowed. More...