9 #if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && !BOOST_LANG_CUDA
10 # error If ALPAKA_ACC_GPU_CUDA_ENABLED is set, the compiler has to support CUDA!
13 #if defined(ALPAKA_ACC_GPU_HIP_ENABLED) && !BOOST_LANG_HIP
14 # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP!
25 template<
typename TAcc>
41 template<
typename TExtent>
50 , m_queue{std::move(queue)}
51 , m_workDiv{std::move(workDiv)}
55 template<
typename TExtent>
59 , m_queue{std::move(queue)}
64 template<
typename TKernelFnObj,
typename... TArgs>
65 auto operator()(TKernelFnObj kernelFnObj, TArgs&&... args) ->
bool
68 auto bufAccResult = allocBuf<bool, Idx>(m_device,
static_cast<Idx>(1u));
69 memset(m_queue, bufAccResult,
static_cast<std::uint8_t
>(
true));
81 std::forward<TArgs>(args)...);
83 exec<Acc>(m_queue, m_workDiv, kernelFnObj,
getPtrNative(bufAccResult), std::forward<TArgs>(args)...);
86 auto bufHostResult = allocBuf<bool, Idx>(m_devHost,
static_cast<Idx>(1u));
87 memcpy(m_queue, bufHostResult, bufAccResult);
102 Vec<Dim, Idx> m_extent;
ALPAKA_NO_HOST_ACC_WARNING static constexpr ALPAKA_FN_HOST_ACC auto ones() -> Vec< TDim, TVal >
One value constructor.
ALPAKA_NO_HOST_ACC_WARNING static constexpr ALPAKA_FN_HOST_ACC auto all(TVal const &val) -> Vec< TDim, TVal >
Single value constructor.
The fixture for executing a kernel on a given accelerator.
WorkDivMembers< Dim, Idx > WorkDiv
KernelExecutionFixture(Queue queue, WorkDiv workDiv)
KernelExecutionFixture(WorkDiv workDiv)
test::DefaultQueue< Device > Queue
alpaka::Platform< Acc > Platform
KernelExecutionFixture(Queue queue, TExtent const &extent)
KernelExecutionFixture(TExtent const &extent)
auto operator()(TKernelFnObj kernelFnObj, TArgs &&... args) -> bool
typename trait::DefaultQueueType< TDev >::type DefaultQueue
The queue type that should be used for the given device.
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
ALPAKA_FN_HOST auto memcpy(TQueue &queue, alpaka::detail::DevGlobalImplGeneric< TTag, TTypeDst > &viewDst, TViewSrc const &viewSrc) -> void
typename trait::DevType< T >::type Dev
The device type trait alias template to remove the ::type.
ALPAKA_FN_HOST auto getValidWorkDiv(KernelCfg< TAcc, TGridElemExtent, TThreadElemExtent > const &kernelCfg, [[maybe_unused]] TDev const &dev, TKernelFnObj const &kernelFnObj, TArgs &&... args) -> WorkDivMembers< Dim< TAcc >, Idx< TAcc >>
ALPAKA_FN_HOST auto getPtrNative(TView const &view) -> Elem< TView > const *
Gets the native pointer of the memory view.
ALPAKA_FN_HOST auto memset(TQueue &queue, TViewFwd &&view, std::uint8_t const &byte, TExtent const &extent) -> void
Sets the bytes of the memory of view, described by extent, to the given value.
ALPAKA_FN_HOST auto getDevByIdx(TPlatform const &platform, std::size_t const &devIdx) -> Dev< TPlatform >
ALPAKA_FN_HOST auto getDev(T const &t)
ALPAKA_FN_HOST auto wait(TAwaited const &awaited) -> void
Waits the thread for the completion of the given awaited action to complete.
typename trait::PlatformType< T >::type Platform
The platform type trait alias template to remove the ::type.
typename trait::DimType< T >::type Dim
The dimension type trait alias template to remove the ::type.
Kernel start configuration to determine a valid work division.