@@ -243,18 +243,28 @@ 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
+ <<<<<<< HEAD
246
247
#ifdef RUN_DEPRECATED
248
+ =======
249
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
247
250
if constexpr (do_ext_tests) {
248
251
add_fetch_local_test<::sycl::ext::oneapi::atomic_ref, space, T,
249
252
Difference, order, scope>(q, N);
250
253
}
254
+ <<<<<<< HEAD
251
255
#else
252
256
add_fetch_local_test<::sycl::atomic_ref, space, T, Difference, order,
253
257
scope>(q, N);
254
258
#endif
255
259
}
256
260
if constexpr (do_global_tests) {
257
261
#ifdef RUN_DEPRECATED
262
+ =======
263
+ add_fetch_local_test<::sycl::atomic_ref, space, T, Difference, order,
264
+ scope>(q, N);
265
+ }
266
+ if constexpr (do_global_tests) {
267
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
258
268
if constexpr (do_ext_tests) {
259
269
add_fetch_test<::sycl::ext::oneapi::atomic_ref, space, T, Difference,
260
270
order, scope>(q, N);
@@ -267,7 +277,10 @@ void add_test(queue q, size_t N) {
267
277
order, scope>(q, N);
268
278
}
269
279
}
280
+ <<<<<<< HEAD
270
281
#else
282
+ =======
283
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
271
284
add_fetch_test<::sycl::atomic_ref, space, T, Difference, order, scope>(q,
272
285
N);
273
286
add_plus_equal_test<::sycl::atomic_ref, space, T, Difference, order, scope>(
@@ -278,7 +291,10 @@ void add_test(queue q, size_t N) {
278
291
add_post_inc_test<::sycl::atomic_ref, space, T, Difference, order, scope>(
279
292
q, N);
280
293
}
294
+ <<<<<<< HEAD
281
295
#endif
296
+ =======
297
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
282
298
}
283
299
}
284
300
@@ -287,6 +303,7 @@ template <access::address_space space, typename T, typename Difference = T,
287
303
void add_test_scopes (queue q, size_t N) {
288
304
std::vector<memory_scope> scopes =
289
305
q.get_device ().get_info <info::device::atomic_memory_scope_capabilities>();
306
+ <<<<<<< HEAD
290
307
if (std::find (scopes.begin (), scopes.end (), memory_scope::system) !=
291
308
scopes.end ()) {
292
309
add_test<space, T, Difference, order, memory_scope::system>(q, N);
@@ -300,12 +317,39 @@ void add_test_scopes(queue q, size_t N) {
300
317
add_test<space, T, Difference, order, memory_scope::sub_group>(q, N);
301
318
}
302
319
add_test<space, T, Difference, order, memory_scope::device>(q, N);
320
+ =======
321
+ #if defined(SYSTEM)
322
+ if (std::find (scopes.begin (), scopes.end (), memory_scope::system) ==
323
+ scopes.end ()) {
324
+ std::cout << " Skipping test\n " ;
325
+ return ;
326
+ }
327
+ add_test<space, T, Difference, order, memory_scope::system>(q, N);
328
+ #elif defined(WORK_GROUP)
329
+ if (std::find (scopes.begin (), scopes.end (), memory_scope::system) ==
330
+ scopes.end ()) {
331
+ std::cout << " Skipping test\n " ;
332
+ return ;
333
+ }
334
+ add_test<space, T, Difference, order, memory_scope::work_group>(q, N);
335
+ #elif defined(SUB_GROUP)
336
+ if (std::find (scopes.begin (), scopes.end (), memory_scope::system) ==
337
+ scopes.end ()) {
338
+ std::cout << " Skipping test\n " ;
339
+ return ;
340
+ }
341
+ add_test<space, T, Difference, order, memory_scope::sub_group>(q, N);
342
+ #else
343
+ add_test<space, T, Difference, order, memory_scope::device>(q, N);
344
+ #endif
345
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
303
346
}
304
347
305
348
template <access::address_space space, typename T, typename Difference = T>
306
349
void add_test_orders_scopes (queue q, size_t N) {
307
350
std::vector<memory_order> orders =
308
351
q.get_device ().get_info <info::device::atomic_memory_order_capabilities>();
352
+ <<<<<<< HEAD
309
353
if (std::find (orders.begin (), orders.end (), memory_order::acq_rel) !=
310
354
orders.end ()) {
311
355
add_test_scopes<space, T, Difference, memory_order::acq_rel>(q, N);
@@ -319,14 +363,51 @@ void add_test_orders_scopes(queue q, size_t N) {
319
363
add_test_scopes<space, T, Difference, memory_order::release>(q, N);
320
364
}
321
365
add_test_scopes<space, T, Difference, memory_order::relaxed>(q, N);
366
+ =======
367
+ #if defined(ACQ_REL)
368
+ if (std::find (orders.begin (), orders.end (), memory_order::acq_rel) ==
369
+ orders.end ()) {
370
+ std::cout << " Skipping test\n " ;
371
+ return ;
372
+ }
373
+ add_test_scopes<space, T, Difference, memory_order::acq_rel>(q, N);
374
+ #elif defined(ACQUIRE)
375
+ if (std::find (orders.begin (), orders.end (), memory_order::acquire) ==
376
+ orders.end ()) {
377
+ std::cout << " Skipping test\n " ;
378
+ return ;
379
+ }
380
+ add_test_scopes<space, T, Difference, memory_order::acquire>(q, N);
381
+ #elif defined(RELEASE)
382
+ if (std::find (orders.begin (), orders.end (), memory_order::release) ==
383
+ orders.end ()) {
384
+ std::cout << " Skipping test\n " ;
385
+ return ;
386
+ }
387
+ add_test_scopes<space, T, Difference, memory_order::release>(q, N);
388
+ #else
389
+ add_test_scopes<space, T, Difference, memory_order::relaxed>(q, N);
390
+ #endif
391
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
322
392
}
323
393
324
394
template <access::address_space space> void add_test_all () {
325
395
queue q;
326
396
327
397
constexpr int N = 32 ;
398
+ <<<<<<< HEAD
328
399
#ifdef FULL_ATOMIC64_COVERAGE
329
400
add_test_orders_scopes<space, double >(q, N);
401
+ =======
402
+ #ifdef ATOMIC64
403
+ if (!q.get_device ().has (aspect::atomic64)) {
404
+ std::cout << " Skipping test\n " ;
405
+ return ;
406
+ }
407
+
408
+ add_test_orders_scopes<space, double >(q, N);
409
+ #ifndef FP_TESTS_ONLY
410
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
330
411
if constexpr (sizeof (long ) == 8 ) {
331
412
add_test_orders_scopes<space, long >(q, N);
332
413
add_test_orders_scopes<space, unsigned long >(q, N);
@@ -339,8 +420,14 @@ template <access::address_space space> void add_test_all() {
339
420
add_test_orders_scopes<space, char *, ptrdiff_t >(q, N);
340
421
}
341
422
#endif
423
+ <<<<<<< HEAD
342
424
add_test_orders_scopes<space, float >(q, N);
343
425
#ifdef FULL_ATOMIC32_COVERAGE
426
+ =======
427
+ #else
428
+ add_test_orders_scopes<space, float >(q, N);
429
+ #ifndef FP_TESTS_ONLY
430
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
344
431
add_test_orders_scopes<space, int >(q, N);
345
432
add_test_orders_scopes<space, unsigned int >(q, N);
346
433
if constexpr (sizeof (long ) == 4 ) {
@@ -351,5 +438,10 @@ template <access::address_space space> void add_test_all() {
351
438
add_test_orders_scopes<space, char *, ptrdiff_t >(q, N);
352
439
}
353
440
#endif
441
+ <<<<<<< HEAD
442
+ =======
443
+ #endif
444
+
445
+ >>>>>>> 88ee9d1a0 ([SYCL] Add tests for atomics with various memory orders and scopes (#534 ))
354
446
std::cout << " Test passed." << std::endl;
355
447
}
0 commit comments