Skip to content

Commit

Permalink
Move static_assert to class body.
Browse files Browse the repository at this point in the history
Signed-off-by: James Brodman <[email protected]>
  • Loading branch information
jbrodman committed Jul 17, 2020
1 parent b175024 commit 18a20fe
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sycl/include/CL/sycl/usm/usm_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@ class usm_allocator {
typedef usm_allocator<U, AllocKind, Alignment> other;
};

static_assert(
AllocKind != usm::alloc::device,
"usm_allocator does not support AllocKind == usm::alloc::device");

usm_allocator() noexcept = delete;
usm_allocator(const context &Ctxt, const device &Dev) noexcept
: MContext(Ctxt), MDevice(Dev) {
static_assert(AllocKind != usm::alloc::device,
"Allocators do not work with device allocations.");
}
: MContext(Ctxt), MDevice(Dev) {}
usm_allocator(const queue &Q) noexcept
: MContext(Q.get_context()), MDevice(Q.get_device()) {
static_assert(AllocKind != usm::alloc::device,
"Allocators do not work with device allocations.");
}
: 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;
Expand Down

0 comments on commit 18a20fe

Please sign in to comment.