@@ -243,14 +243,18 @@ void add_test(queue q, size_t N) {
243
243
(space == access::address_space::generic_space && !TEST_GENERIC_IN_LOCAL);
244
244
constexpr bool do_ext_tests = space != access::address_space::generic_space;
245
245
if constexpr (do_local_tests) {
246
+ #ifdef RUN_DEPRECATED
246
247
if constexpr (do_ext_tests) {
247
248
add_fetch_local_test<::sycl::ext::oneapi::atomic_ref, space, T,
248
249
Difference, order, scope>(q, N);
249
250
}
251
+ #else
250
252
add_fetch_local_test<::sycl::atomic_ref, space, T, Difference, order,
251
253
scope>(q, N);
254
+ #endif
252
255
}
253
256
if constexpr (do_global_tests) {
257
+ #ifdef RUN_DEPRECATED
254
258
if constexpr (do_ext_tests) {
255
259
add_fetch_test<::sycl::ext::oneapi::atomic_ref, space, T, Difference,
256
260
order, scope>(q, N);
@@ -263,6 +267,7 @@ void add_test(queue q, size_t N) {
263
267
order, scope>(q, N);
264
268
}
265
269
}
270
+ #else
266
271
add_fetch_test<::sycl::atomic_ref, space, T, Difference, order, scope>(q,
267
272
N);
268
273
add_plus_equal_test<::sycl::atomic_ref, space, T, Difference, order, scope>(
@@ -273,6 +278,7 @@ void add_test(queue q, size_t N) {
273
278
add_post_inc_test<::sycl::atomic_ref, space, T, Difference, order, scope>(
274
279
q, N);
275
280
}
281
+ #endif
276
282
}
277
283
}
278
284
@@ -281,74 +287,46 @@ template <access::address_space space, typename T, typename Difference = T,
281
287
void add_test_scopes (queue q, size_t N) {
282
288
std::vector<memory_scope> scopes =
283
289
q.get_device ().get_info <info::device::atomic_memory_scope_capabilities>();
284
- #if defined(SYSTEM)
285
- if (std::find (scopes.begin (), scopes.end (), memory_scope::system) ==
290
+ if (std::find (scopes.begin (), scopes.end (), memory_scope::system) !=
286
291
scopes.end ()) {
287
- std::cout << " Skipping test\n " ;
288
- return ;
292
+ add_test<space, T, Difference, order, memory_scope::system>(q, N);
289
293
}
290
- add_test<space, T, Difference, order, memory_scope::system>(q, N);
291
- #elif defined(WORK_GROUP)
292
- if (std::find (scopes.begin (), scopes.end (), memory_scope::system) ==
294
+ if (std::find (scopes.begin (), scopes.end (), memory_scope::work_group) !=
293
295
scopes.end ()) {
294
- std::cout << " Skipping test\n " ;
295
- return ;
296
+ add_test<space, T, Difference, order, memory_scope::work_group>(q, N);
296
297
}
297
- add_test<space, T, Difference, order, memory_scope::work_group>(q, N);
298
- #elif defined(SUB_GROUP)
299
- if (std::find (scopes.begin (), scopes.end (), memory_scope::system) ==
298
+ if (std::find (scopes.begin (), scopes.end (), memory_scope::sub_group) !=
300
299
scopes.end ()) {
301
- std::cout << " Skipping test\n " ;
302
- return ;
300
+ add_test<space, T, Difference, order, memory_scope::sub_group>(q, N);
303
301
}
304
- add_test<space, T, Difference, order, memory_scope::sub_group>(q, N);
305
- #else
306
302
add_test<space, T, Difference, order, memory_scope::device>(q, N);
307
- #endif
308
303
}
309
304
310
305
template <access::address_space space, typename T, typename Difference = T>
311
306
void add_test_orders_scopes (queue q, size_t N) {
312
307
std::vector<memory_order> orders =
313
308
q.get_device ().get_info <info::device::atomic_memory_order_capabilities>();
314
- #if defined(ACQ_REL)
315
- if (std::find (orders.begin (), orders.end (), memory_order::acq_rel) ==
309
+ if (std::find (orders.begin (), orders.end (), memory_order::acq_rel) !=
316
310
orders.end ()) {
317
- std::cout << " Skipping test\n " ;
318
- return ;
311
+ add_test_scopes<space, T, Difference, memory_order::acq_rel>(q, N);
319
312
}
320
- add_test_scopes<space, T, Difference, memory_order::acq_rel>(q, N);
321
- #elif defined(ACQUIRE)
322
- if (std::find (orders.begin (), orders.end (), memory_order::acquire) ==
313
+ if (std::find (orders.begin (), orders.end (), memory_order::acquire) !=
323
314
orders.end ()) {
324
- std::cout << " Skipping test\n " ;
325
- return ;
315
+ add_test_scopes<space, T, Difference, memory_order::acquire>(q, N);
326
316
}
327
- add_test_scopes<space, T, Difference, memory_order::acquire>(q, N);
328
- #elif defined(RELEASE)
329
- if (std::find (orders.begin (), orders.end (), memory_order::release) ==
317
+ if (std::find (orders.begin (), orders.end (), memory_order::release) !=
330
318
orders.end ()) {
331
- std::cout << " Skipping test\n " ;
332
- return ;
319
+ add_test_scopes<space, T, Difference, memory_order::release>(q, N);
333
320
}
334
- add_test_scopes<space, T, Difference, memory_order::release>(q, N);
335
- #else
336
321
add_test_scopes<space, T, Difference, memory_order::relaxed>(q, N);
337
- #endif
338
322
}
339
323
340
324
template <access::address_space space> void add_test_all () {
341
325
queue q;
342
326
343
327
constexpr int N = 32 ;
344
- #ifdef ATOMIC64
345
- if (!q.get_device ().has (aspect::atomic64)) {
346
- std::cout << " Skipping test\n " ;
347
- return ;
348
- }
349
-
328
+ #ifdef FULL_ATOMIC64_COVERAGE
350
329
add_test_orders_scopes<space, double >(q, N);
351
- #ifndef FP_TESTS_ONLY
352
330
if constexpr (sizeof (long ) == 8 ) {
353
331
add_test_orders_scopes<space, long >(q, N);
354
332
add_test_orders_scopes<space, unsigned long >(q, N);
@@ -361,9 +339,8 @@ template <access::address_space space> void add_test_all() {
361
339
add_test_orders_scopes<space, char *, ptrdiff_t >(q, N);
362
340
}
363
341
#endif
364
- #else
365
342
add_test_orders_scopes<space, float >(q, N);
366
- #ifndef FP_TESTS_ONLY
343
+ #ifdef FULL_ATOMIC32_COVERAGE
367
344
add_test_orders_scopes<space, int >(q, N);
368
345
add_test_orders_scopes<space, unsigned int >(q, N);
369
346
if constexpr (sizeof (long ) == 4 ) {
@@ -374,7 +351,5 @@ template <access::address_space space> void add_test_all() {
374
351
add_test_orders_scopes<space, char *, ptrdiff_t >(q, N);
375
352
}
376
353
#endif
377
- #endif
378
-
379
354
std::cout << " Test passed." << std::endl;
380
355
}
0 commit comments