Skip to content

Commit 39dacdf

Browse files
committed
Suppress DPC++ deprecation warnings about sycl::atomic
1 parent baa242a commit 39dacdf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/accessor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ class accessor<DataT, Dims, Mode, target::device> : public detail::accessor_base
261261
return detail::ranged_sycl_access(sycl_accessor, buffer_range, index - index_offset);
262262
}
263263

264+
#pragma GCC diagnostic push
265+
// Ignore deprecation warnings emitted by SYCL implementations (e.g. hipSYCL)
266+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
264267
template <access_mode M = Mode, int D = Dims>
265268
[[deprecated("Atomic accessors are deprecated as of SYCL 2020")]] std::enable_if_t<M == access_mode::atomic && (D > 0), cl::sycl::atomic<DataT>> operator[](
266269
id<Dims> index) const {
267-
#pragma GCC diagnostic push
268-
// Ignore deprecation warnings emitted by SYCL implementations (e.g. hipSYCL)
269-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
270270
return detail::ranged_sycl_access(sycl_accessor, buffer_range, index - index_offset);
271-
#pragma GCC diagnostic pop
272271
}
272+
#pragma GCC diagnostic pop
273273

274274
template <int D = Dims>
275275
std::enable_if_t<(D > 1), detail::accessor_subscript_proxy<DataT, D, Mode, target::device, 1>> operator[](const size_t d0) const {

0 commit comments

Comments
 (0)