6
6
// TODO: Behaviour is unstable for level zero on Windows. Enable when fixed.
7
7
// UNSUPPORTED: windows && level_zero
8
8
9
+ #define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10
+
11
+ #include < CL/sycl.hpp>
12
+
9
13
#include < atomic>
10
14
#include < condition_variable>
11
15
#include < future>
12
16
#include < mutex>
13
17
#include < thread>
14
18
15
- #include < CL/sycl.hpp>
16
-
17
19
namespace S = cl::sycl;
18
20
21
+ template <typename T, bool B>
22
+ class NameGen ;
23
+
19
24
struct Context {
20
25
std::atomic_bool Flag;
21
26
S::queue &Queue;
@@ -93,7 +98,7 @@ template <bool UseSYCL2020HostTask> void Thread1Fn(Context *Ctx) {
93
98
GeneratorAcc[Idx] = Idx;
94
99
};
95
100
96
- CGH.single_task <class GeneratorTask >(GeneratorKernel);
101
+ CGH.single_task <NameGen< class Gen , UseSYCL2020HostTask> >(GeneratorKernel);
97
102
});
98
103
99
104
// 2. submit host task writing from buf 1 to buf 2
@@ -114,7 +119,7 @@ template <bool UseSYCL2020HostTask> void Thread1Fn(Context *Ctx) {
114
119
DstAcc[Idx] = SrcAcc[Idx];
115
120
};
116
121
117
- CGH.single_task <class CopierTask >(CopierKernel);
122
+ CGH.single_task <NameGen< class Copier , UseSYCL2020HostTask> >(CopierKernel);
118
123
});
119
124
120
125
// 4. check data in buffer #3
@@ -155,7 +160,8 @@ template <bool UseSYCL2020HostTask> void test() {
155
160
Context Ctx{{false }, Queue, {10 }, {10 }, {10 }, {}, {}};
156
161
157
162
// 0. setup: thread 1 T1: exec smth; thread 2 T2: waits; init flag F = false
158
- auto A1 = std::async (std::launch::async, Thread1Fn<true >, &Ctx);
163
+ auto A1 =
164
+ std::async (std::launch::async, Thread1Fn<UseSYCL2020HostTask>, &Ctx);
159
165
auto A2 = std::async (std::launch::async, Thread2Fn, &Ctx);
160
166
161
167
A1.get ();
0 commit comments