16
16
// There was a bug in previous L0 drivers that caused the test to fail
17
17
std::tuple<size_t , size_t , size_t > minL0DriverVersion = {1 , 3 , 29534 };
18
18
19
- template <size_t minDevices, typename T>
19
+ template <size_t minDevices, typename T, bool trueMultiDevice = true >
20
20
struct urMultiQueueLaunchMemcpyTest
21
- : uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T> {
21
+ : uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
22
+ trueMultiDevice> {
22
23
std::string KernelName;
23
24
std::vector<ur_program_handle_t > programs;
24
25
std::vector<ur_kernel_handle_t > kernels;
@@ -28,17 +29,22 @@ struct urMultiQueueLaunchMemcpyTest
28
29
static constexpr size_t ArraySize = 100 ;
29
30
static constexpr uint32_t InitialValue = 1 ;
30
31
31
- using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::devices;
32
- using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::platform;
33
- using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::context;
34
- using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::queues;
32
+ using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
33
+ trueMultiDevice>::devices;
34
+ using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
35
+ trueMultiDevice>::platform;
36
+ using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
37
+ trueMultiDevice>::context;
38
+ using uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
39
+ trueMultiDevice>::queues;
35
40
36
41
void SetUp () override {
37
42
// We haven't got device code tests working on native cpu yet.
38
43
UUR_KNOWN_FAILURE_ON (uur::NativeCPU{});
39
44
40
45
UUR_RETURN_ON_FATAL_FAILURE (
41
- uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::SetUp ());
46
+ uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
47
+ trueMultiDevice>::SetUp ());
42
48
43
49
for (auto &device : devices) {
44
50
SKIP_IF_DRIVER_TOO_OLD (" Level-Zero" , minL0DriverVersion, platform,
@@ -100,7 +106,8 @@ struct urMultiQueueLaunchMemcpyTest
100
106
urProgramRelease (program);
101
107
}
102
108
UUR_RETURN_ON_FATAL_FAILURE (
103
- uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T>::TearDown ());
109
+ uur::urMultiQueueMultiDeviceTestWithParam<minDevices, T,
110
+ trueMultiDevice>::TearDown ());
104
111
}
105
112
106
113
void runBackgroundCheck (std::vector<uur::raii::Event> &Events) {
@@ -150,26 +157,24 @@ struct urEnqueueKernelLaunchIncrementMultiDeviceTestWithParam
150
157
};
151
158
152
159
struct urEnqueueKernelLaunchIncrementTest
153
- : urMultiQueueLaunchMemcpyTest<50 , uur::BoolTestParam> {
160
+ : urMultiQueueLaunchMemcpyTest<50 , uur::BoolTestParam, false > {
154
161
static constexpr size_t numOps = 50 ;
155
162
156
163
using Param = uur::BoolTestParam;
157
164
158
- using urMultiQueueLaunchMemcpyTest<numOps, Param>::context;
159
- using urMultiQueueLaunchMemcpyTest<numOps, Param>::queues;
160
- using urMultiQueueLaunchMemcpyTest<numOps, Param>::devices;
161
- using urMultiQueueLaunchMemcpyTest<numOps, Param>::kernels;
162
- using urMultiQueueLaunchMemcpyTest<numOps, Param>::SharedMem;
165
+ using urMultiQueueLaunchMemcpyTest<numOps, Param, false >::queues;
166
+ using urMultiQueueLaunchMemcpyTest<numOps, Param, false >::kernels;
167
+ using urMultiQueueLaunchMemcpyTest<numOps, Param, false >::SharedMem;
163
168
164
169
void SetUp () override {
165
170
UUR_RETURN_ON_FATAL_FAILURE (
166
- urMultiQueueLaunchMemcpyTest<numOps, Param>::
171
+ urMultiQueueLaunchMemcpyTest<numOps, Param, false >::
167
172
SetUp ()); // Use single device, duplicated numOps times
168
173
}
169
174
170
175
void TearDown () override {
171
176
UUR_RETURN_ON_FATAL_FAILURE (
172
- urMultiQueueLaunchMemcpyTest<numOps, Param>::TearDown ());
177
+ urMultiQueueLaunchMemcpyTest<numOps, Param, false >::TearDown ());
173
178
}
174
179
};
175
180
@@ -180,9 +185,6 @@ UUR_PLATFORM_TEST_SUITE_WITH_PARAM(
180
185
181
186
TEST_P (urEnqueueKernelLaunchIncrementTest, Success) {
182
187
UUR_KNOWN_FAILURE_ON (uur::LevelZeroV2{});
183
- if (devices.size () > 1 ) {
184
- UUR_KNOWN_FAILURE_ON (uur::CUDA{});
185
- }
186
188
187
189
constexpr size_t global_offset = 0 ;
188
190
constexpr size_t n_dimensions = 1 ;
@@ -361,14 +363,10 @@ UUR_PLATFORM_TEST_SUITE_WITH_PARAM(
361
363
// Enqueue kernelLaunch concurrently from multiple threads
362
364
// With !queuePerThread this becomes a test on a single device
363
365
TEST_P (urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, Success) {
364
- if (devices.size () > 1 ) {
365
- UUR_KNOWN_FAILURE_ON (uur::CUDA{});
366
- }
367
366
auto useEvents = std::get<0 >(getParam ()).value ;
368
367
auto queuePerThread = std::get<1 >(getParam ()).value ;
369
-
370
368
if (!queuePerThread) {
371
- UUR_KNOWN_FAILURE_ON (uur::LevelZero{}, uur::LevelZeroV2{});
369
+ UUR_KNOWN_FAILURE_ON (uur::LevelZero{}, uur::LevelZeroV2{}, uur::CUDA{} );
372
370
}
373
371
374
372
size_t numThreads = devices.size ();
@@ -382,7 +380,7 @@ TEST_P(urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest, Success) {
382
380
constexpr size_t n_dimensions = 1 ;
383
381
384
382
auto queue = queuePerThread ? queues[i] : queues.back ();
385
- auto kernel = kernels[i];
383
+ auto kernel = queuePerThread ? kernels[i] : kernels. back () ;
386
384
auto sharedPtr = SharedMem[i];
387
385
388
386
std::vector<uur::raii::Event> Events (numOpsPerThread + 1 );
0 commit comments