|
3 | 3 |
|
4 | 4 | #if defined(CUDA) |
5 | 5 | #include "CUDAStream.h" |
6 | | -#elif defined(STD_DATA) |
7 | | -#include "STDDataStream.h" |
8 | | -#elif defined(STD_INDICES) |
9 | | -#include "STDIndicesStream.h" |
10 | | -#elif defined(STD_RANGES) |
11 | | -#include "STDRangesStream.hpp" |
| 6 | +#elif defined(STD) |
| 7 | +#include "STDStream.h" |
12 | 8 | #elif defined(TBB) |
13 | 9 | #include "TBBStream.hpp" |
14 | 10 | #elif defined(THRUST) |
|
31 | 27 | #include "SYCLStream2020.h" |
32 | 28 | #elif defined(OMP) |
33 | 29 | #include "OMPStream.h" |
| 30 | +#elif defined(SERIAL) |
| 31 | +#include "SerialStream.h" |
34 | 32 | #elif defined(FUTHARK) |
35 | 33 | #include "FutharkStream.h" |
36 | 34 | #endif |
37 | 35 |
|
38 | | -template <typename T> |
39 | | -std::unique_ptr<Stream<T>> make_stream(intptr_t array_size, int deviceIndex) { |
| 36 | +template <typename T, typename...Args> |
| 37 | +std::unique_ptr<Stream<T>> make_stream(Args... args) { |
40 | 38 | #if defined(CUDA) |
41 | 39 | // Use the CUDA implementation |
42 | | - return std::make_unique<CUDAStream<T>>(array_size, deviceIndex); |
| 40 | + return std::make_unique<CUDAStream<T>>(args...); |
43 | 41 |
|
44 | 42 | #elif defined(HIP) |
45 | 43 | // Use the HIP implementation |
46 | | - return std::make_unique<HIPStream<T>>(array_size, deviceIndex); |
| 44 | + return std::make_unique<HIPStream<T>>(args...); |
47 | 45 |
|
48 | 46 | #elif defined(HC) |
49 | 47 | // Use the HC implementation |
50 | | - return std::make_unique<HCStream<T>>(array_size, deviceIndex); |
| 48 | + return std::make_unique<HCStream<T>>(args...); |
51 | 49 |
|
52 | 50 | #elif defined(OCL) |
53 | 51 | // Use the OpenCL implementation |
54 | | - return std::make_unique<OCLStream<T>>(array_size, deviceIndex); |
| 52 | + return std::make_unique<OCLStream<T>>(args...); |
55 | 53 |
|
56 | 54 | #elif defined(USE_RAJA) |
57 | 55 | // Use the RAJA implementation |
58 | | - return std::make_unique<RAJAStream<T>>(array_size, deviceIndex); |
| 56 | + return std::make_unique<RAJAStream<T>>(args...); |
59 | 57 |
|
60 | 58 | #elif defined(KOKKOS) |
61 | 59 | // Use the Kokkos implementation |
62 | | - return std::make_unique<KokkosStream<T>>(array_size, deviceIndex); |
| 60 | + return std::make_unique<KokkosStream<T>>(args...); |
63 | 61 |
|
64 | | -#elif defined(STD_DATA) |
| 62 | +#elif defined(STD) |
65 | 63 | // Use the C++ STD data-oriented implementation |
66 | | - return std::make_unique<STDDataStream<T>>(array_size, deviceIndex); |
67 | | - |
68 | | -#elif defined(STD_INDICES) |
69 | | - // Use the C++ STD index-oriented implementation |
70 | | - return std::make_unique<STDIndicesStream<T>>(array_size, deviceIndex); |
71 | | - |
72 | | -#elif defined(STD_RANGES) |
73 | | - // Use the C++ STD ranges implementation |
74 | | - return std::make_unique<STDRangesStream<T>>(array_size, deviceIndex); |
| 64 | + return std::make_unique<STDStream<T>>(args...); |
75 | 65 |
|
76 | 66 | #elif defined(TBB) |
77 | 67 | // Use the C++20 implementation |
78 | | - return std::make_unique<TBBStream<T>>(array_size, deviceIndex); |
| 68 | + return std::make_unique<TBBStream<T>>(args...); |
79 | 69 |
|
80 | 70 | #elif defined(THRUST) |
81 | 71 | // Use the Thrust implementation |
82 | | - return std::make_unique<ThrustStream<T>>(array_size, deviceIndex); |
| 72 | + return std::make_unique<ThrustStream<T>>(args...); |
83 | 73 |
|
84 | 74 | #elif defined(ACC) |
85 | 75 | // Use the OpenACC implementation |
86 | | - return std::make_unique<ACCStream<T>>(array_size, deviceIndex); |
| 76 | + return std::make_unique<ACCStream<T>>(args...); |
87 | 77 |
|
88 | 78 | #elif defined(SYCL) || defined(SYCL2020) |
89 | 79 | // Use the SYCL implementation |
90 | | - return std::make_unique<SYCLStream<T>>(array_size, deviceIndex); |
| 80 | + return std::make_unique<SYCLStream<T>>(args...); |
91 | 81 |
|
92 | 82 | #elif defined(OMP) |
93 | 83 | // Use the OpenMP implementation |
94 | | - return std::make_unique<OMPStream<T>>(array_size, deviceIndex); |
| 84 | + return std::make_unique<OMPStream<T>>(args...); |
| 85 | + |
| 86 | +#elif defined(SERIAL) |
| 87 | + // Use the Serial implementation |
| 88 | + return std::make_unique<SerialStream<T>>(args...); |
95 | 89 |
|
96 | 90 | #elif defined(FUTHARK) |
97 | 91 | // Use the Futhark implementation |
98 | | - return std::make_unique<FutharkStream<T>>(array_size, deviceIndex); |
| 92 | + return std::make_unique<FutharkStream<T>>(args...); |
99 | 93 |
|
100 | 94 | #else |
101 | 95 |
|
|
0 commit comments