From 4ffffe0c1e03459ba605caca7d5194899664a875 Mon Sep 17 00:00:00 2001 From: KornevNikita Date: Thu, 27 Oct 2022 06:21:31 -0700 Subject: [PATCH] [SYCL] Fix accessor::swap() method Need to swap new member MAccData in addition to Impl 01e60f76b3484913fad27d8b0e5fe627d9151689 --- sycl/include/sycl/accessor.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; }