diff --git a/sycl/include/CL/sycl/usm/usm_allocator.hpp b/sycl/include/CL/sycl/usm/usm_allocator.hpp index 3270fa1d6d67e..5c25673841926 100644 --- a/sycl/include/CL/sycl/usm/usm_allocator.hpp +++ b/sycl/include/CL/sycl/usm/usm_allocator.hpp @@ -50,8 +50,16 @@ class usm_allocator { : MContext(Q.get_context()), MDevice(Q.get_device()) {} usm_allocator(const usm_allocator &) noexcept = default; usm_allocator(usm_allocator &&) noexcept = default; - usm_allocator &operator=(const usm_allocator &) = delete; - usm_allocator &operator=(usm_allocator &&) = default; + usm_allocator &operator=(const usm_allocator &Other) { + MContext = Other.MContext; + MDevice = Other.MDevice; + return *this; + } + usm_allocator &operator=(usm_allocator &&Other) { + MContext = std::move(Other.MContext); + MDevice = std::move(Other.MDevice); + return *this; + } template usm_allocator(const usm_allocator &Other) noexcept @@ -101,8 +109,8 @@ class usm_allocator { template friend class usm_allocator; - const context MContext; - const device MDevice; + context MContext; + device MDevice; }; } // namespace sycl