alpaka
Abstraction Library for Parallel Kernel Acceleration
alpaka::trait::OmpSchedule< TKernelFnObj, TAcc, TSfinae > Struct Template Reference

The trait for getting the schedule to use when a kernel is run using the CpuOmp2Blocks accelerator. More...

#include <Traits.hpp>

Static Public Member Functions

template<typename TDim , typename... TArgs>
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST auto getOmpSchedule ([[maybe_unused]] TKernelFnObj const &kernelFnObj, [[maybe_unused]] Vec< TDim, Idx< TAcc >> const &blockThreadExtent, [[maybe_unused]] Vec< TDim, Idx< TAcc >> const &threadElemExtent, [[maybe_unused]] TArgs const &... args) -> TraitNotSpecialized
 

Detailed Description

template<typename TKernelFnObj, typename TAcc, typename TSfinae = void>
struct alpaka::trait::OmpSchedule< TKernelFnObj, TAcc, TSfinae >

The trait for getting the schedule to use when a kernel is run using the CpuOmp2Blocks accelerator.

Has no effect on other accelerators.

A user could either specialize this trait for their kernel, or define a public static member ompScheduleKind of type alpaka::omp::Schedule, and additionally also int member ompScheduleChunkSize. In the latter case, alpaka never odr-uses these members.

In case schedule kind and chunk size are compile-time constants, setting then inside kernel may benefit performance.

Template Parameters
TKernelFnObjThe kernel function object.
TAccThe accelerator.

The default implementation behaves as if the trait was not specialized.

Definition at line 127 of file Traits.hpp.

Member Function Documentation

◆ getOmpSchedule()

template<typename TKernelFnObj , typename TAcc , typename TSfinae = void>
template<typename TDim , typename... TArgs>
ALPAKA_NO_HOST_ACC_WARNING static ALPAKA_FN_HOST auto alpaka::trait::OmpSchedule< TKernelFnObj, TAcc, TSfinae >::getOmpSchedule ( [[maybe_unused] ] TKernelFnObj const &  kernelFnObj,
[[maybe_unused] ] Vec< TDim, Idx< TAcc >> const &  blockThreadExtent,
[[maybe_unused] ] Vec< TDim, Idx< TAcc >> const &  threadElemExtent,
[[maybe_unused] ] TArgs const &...  args 
) -> TraitNotSpecialized
inlinestatic
Parameters
kernelFnObjThe kernel object for which the schedule should be returned.
blockThreadExtentThe block thread extent.
threadElemExtentThe thread element extent.
Template Parameters
TArgsThe kernel invocation argument types pack.
Parameters
args,...The kernel invocation arguments.
Returns
The OpenMP schedule information as an alpaka::omp::Schedule object, returning an object of any other type is treated as if the trait is not specialized.

Definition at line 153 of file Traits.hpp.


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