Skip to content

Commit d05ff71

Browse files
authored
[SYCL][E2E] Fix warnings in AtomicRef e2e tests (#14221)
- Remove deprecated use of `get_pointer` in `atomic_memory_order_acq_rel.cpp` - Compile `atomic_memory_order_acq_rel.cpp` and `atomic_memory_order_seq_cst.cpp` with cuda backend flags, only if there is a cuda device
1 parent 088a947 commit d05ff71

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

sycl/test-e2e/AtomicRef/atomic_memory_order_acq_rel.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %{build} -O3 -o %t.out -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70
1+
// RUN: %{build} -O3 -o %t.out %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %}
22
// RUN: %{run} %t.out
33

44
// NOTE: Tests fetch_add for acquire and release memory ordering.
@@ -25,7 +25,7 @@ template <memory_order order> void test_acquire_global() {
2525
error_buf.template get_access<access::mode::read_write>(cgh);
2626
auto val = val_buf.template get_access<access::mode::read_write>(cgh);
2727
cgh.parallel_for(range<1>(N_items), [=](item<1> it) {
28-
volatile int *val_p = val.get_pointer();
28+
volatile int *val_p = val.get_multi_ptr<access::decorated::no>().get();
2929
auto atm0 =
3030
atomic_ref<int, memory_order::relaxed, memory_scope::device,
3131
access::address_space::global_space>(val[0]);
@@ -74,7 +74,8 @@ template <memory_order order> void test_acquire_local() {
7474
val[0] = 0;
7575
val[1] = 0;
7676
it.barrier(access::fence_space::local_space);
77-
volatile int *val_p = val.get_pointer();
77+
volatile int *val_p =
78+
val.get_multi_ptr<access::decorated::no>().get();
7879
auto atm0 =
7980
atomic_ref<int, memory_order::relaxed, memory_scope::device,
8081
access::address_space::local_space>(val[0]);
@@ -116,7 +117,7 @@ template <memory_order order> void test_release_global() {
116117
error_buf.template get_access<access::mode::read_write>(cgh);
117118
auto val = val_buf.template get_access<access::mode::read_write>(cgh);
118119
cgh.parallel_for(range<1>(N_items), [=](item<1> it) {
119-
volatile int *val_p = val.get_pointer();
120+
volatile int *val_p = val.get_multi_ptr<access::decorated::no>().get();
120121
auto atm0 =
121122
atomic_ref<int, memory_order::relaxed, memory_scope::device,
122123
access::address_space::global_space>(val[0]);
@@ -165,7 +166,8 @@ template <memory_order order> void test_release_local() {
165166
val[0] = 0;
166167
val[1] = 0;
167168
it.barrier(access::fence_space::local_space);
168-
volatile int *val_p = val.get_pointer();
169+
volatile int *val_p =
170+
val.get_multi_ptr<access::decorated::no>().get();
169171
auto atm0 =
170172
atomic_ref<int, memory_order::relaxed, memory_scope::device,
171173
access::address_space::local_space>(val[0]);

sycl/test-e2e/AtomicRef/atomic_memory_order_seq_cst.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %{build} -O3 -o %t.out -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70
1+
// RUN: %{build} -O3 -o %t.out %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70 %}
22
// RUN: %{run} %t.out
33

44
#include "atomic_memory_order.h"

0 commit comments

Comments
 (0)