Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions sycl/include/CL/sycl/usm/usm_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class U>
usm_allocator(const usm_allocator<U, AllocKind, Alignment> &Other) noexcept
Expand Down Expand Up @@ -101,8 +109,8 @@ class usm_allocator {
template <class U, usm::alloc AllocKindU, size_t AlignmentU>
friend class usm_allocator;

const context MContext;
const device MDevice;
context MContext;
device MDevice;
};

} // namespace sycl
Expand Down