alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
executor.hpp
Go to the documentation of this file.
1/* Copyright 2024 René Widera, Mehmet Yusufoglu
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
11#include "alpaka/core/PP.hpp"
12
13namespace alpaka::exec
14{
15 /** list of all executors supported by alpaka
16 *
17 * The order is from high parallelism to low parallelism for executors which are falling into the same category.
18 * This list is used at places where a function can be called without an executor. In this case the first available
19 * executor is used.
20 */
21 constexpr auto allExecutors = std::make_tuple(gpuCuda, gpuHip, oneApi, cpuOmpBlocks, cpuTbbBlocks, cpuSerial);
22
23 /** list of enabled executors
24 *
25 * - executors can be dis-/enabled by the CMake define alpaka_EXEC_<ExecutorName>
26 * - the second way to disable an executor is to define the preprocessor define ALPAKA_DISABLE_EXEC_<ExecutorName>,
27 * if not the executor is enabled
28 */
29 constexpr auto enabledExecutors = std::tuple_cat(
30 // empty tuple to avoid issues with the first comma
31 std::tuple<>{}
32#ifndef ALPAKA_DISABLE_EXEC_CpuOmpBlocks
33 ,
34 std::tuple{exec::cpuOmpBlocks}
35#endif
36#ifndef ALPAKA_DISABLE_EXEC_CpuTbbBlocks
37 ,
38 std::tuple{exec::cpuTbbBlocks}
39#endif
40#ifndef ALPAKA_DISABLE_EXEC_CpuSerial
41 ,
42 std::tuple{exec::cpuSerial}
43#endif
44#ifndef ALPAKA_DISABLE_EXEC_GpuCuda
45 ,
46 std::tuple{exec::gpuCuda}
47#endif
48#ifndef ALPAKA_DISABLE_EXEC_GpuHip
49 ,
50 std::tuple{exec::gpuHip}
51#endif
52#ifndef ALPAKA_DISABLE_EXEC_OneApi
53 ,
54 std::tuple{exec::oneApi}
55#endif
56 );
57} // namespace alpaka::exec
constexpr GpuCuda gpuCuda
Definition executor.hpp:25
constexpr GpuHip gpuHip
Definition executor.hpp:25
constexpr CpuTbbBlocks cpuTbbBlocks
Definition executor.hpp:48
constexpr CpuOmpBlocks cpuOmpBlocks
Definition executor.hpp:38
constexpr auto allExecutors
list of all executors supported by alpaka
Definition executor.hpp:21
constexpr OneApi oneApi
Definition executor.hpp:22
constexpr auto enabledExecutors
list of enabled executors
Definition executor.hpp:29
constexpr CpuSerial cpuSerial
Definition executor.hpp:28