diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index 396c3000fd613..b8d483c7d2c25 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -1945,7 +1945,12 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : #endif } - void swap(accessor &other) { std::swap(impl, other.impl); } + void swap(accessor &other) { + std::swap(impl, other.impl); +#ifndef __SYCL_DEVICE_ONLY__ + std::swap(MAccData, other.MAccData); +#endif + } constexpr bool is_placeholder() const { return IsPlaceH; }