alpaka
Abstraction Library for Parallel Kernel Acceleration
ExampleDefaultAcc.hpp
Go to the documentation of this file.
1 /* Copyright 2023 Jeffrey Kelling, Bernhard Manfred Gruber, Jan Stephan, Aurora Perego, Andrea Bocci
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #include "alpaka/alpaka.hpp"
6 
7 #pragma once
8 
9 namespace alpaka
10 {
11  //! Alias for the default accelerator used by examples. From a list of
12  //! all accelerators the first one which is enabled is chosen.
13  //! AccCpuSerial is selected last.
14  template<class TDim, class TIdx>
15 #if defined(ALPAKA_ACC_GPU_CUDA_ENABLED)
17 #elif defined(ALPAKA_ACC_GPU_HIP_ENABLED)
18  using ExampleDefaultAcc = alpaka::AccGpuHipRt<TDim, TIdx>;
19 #elif defined(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED)
21 #elif defined(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLED)
22  using ExampleDefaultAcc = alpaka::AccCpuTbbBlocks<TDim, TIdx>;
23 #elif defined(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED)
25 #elif defined(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED)
27 #elif defined(ALPAKA_ACC_SYCL_ENABLED)
28 # if defined(ALPAKA_SYCL_ONEAPI_CPU)
29  using ExampleDefaultAcc = alpaka::AccCpuSycl<TDim, TIdx>;
30 # elif defined(ALPAKA_SYCL_ONEAPI_FPGA)
31  using ExampleDefaultAcc = alpaka::AccFpgaSyclIntel<TDim, TIdx>;
32 # elif defined(ALPAKA_SYCL_ONEAPI_GPU)
33  using ExampleDefaultAcc = alpaka::AccGpuSyclIntel<TDim, TIdx>;
34 # endif
35 #elif defined(ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED)
37 #else
38  class ExampleDefaultAcc;
39 # warning "No supported backend selected."
40 #endif
41 } // namespace alpaka
The CPU OpenMP 2.0 block accelerator.
The CPU OpenMP 2.0 thread accelerator.
The CPU serial accelerator.
The CPU threads accelerator.
The alpaka accelerator library.