diff --git a/sycl/include/CL/sycl/atomic.hpp b/sycl/include/CL/sycl/atomic.hpp index 8c6a3ed10101f..944a648bcbe6c 100644 --- a/sycl/include/CL/sycl/atomic.hpp +++ b/sycl/include/CL/sycl/atomic.hpp @@ -168,7 +168,8 @@ namespace sycl { template -class atomic { +class __SYCL2020_DEPRECATED( + "sycl::atomic is deprecated since SYCL 2020") atomic { friend class atomic; static_assert(detail::IsValidAtomicType::value, "Invalid SYCL atomic type. Valid types are: int, " diff --git a/sycl/test/warnings/sycl_2020_deprecations.cpp b/sycl/test/warnings/sycl_2020_deprecations.cpp index 3518540b93378..745406f02ebf0 100644 --- a/sycl/test/warnings/sycl_2020_deprecations.cpp +++ b/sycl/test/warnings/sycl_2020_deprecations.cpp @@ -1,7 +1,4 @@ // RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2020 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out -// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out -// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=2017 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out -// RUN: %clangxx %fsycl-host-only -fsyntax-only -sycl-std=1.2.1 -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out #include #include @@ -176,6 +173,11 @@ int main() { // expected-warning@+1{{'barrier' is deprecated: use 'ext_oneapi_barrier' instead}} Queue.submit([&](sycl::handler &CGH) { CGH.barrier(); }); - + + cl::sycl::multi_ptr a( + nullptr); + // expected-warning@+1 {{'atomic' is deprecated: sycl::atomic is deprecated since SYCL 2020}} + cl::sycl::atomic b(a); + return 0; }