112 void* address_ =
nullptr;
113 std::size_t nbytes_ = 0;
Managed memory buffer with explicit ownership.
Definition: buffer.hpp:56
Buffer(Buffer &&other) noexcept
Move constructor transfers ownership.
~Buffer()
Destructor releases owned memory.
const void * address() const
Gets read-only pointer to memory
Buffer(const Buffer &)=delete
std::size_t nbytes() const
Gets buffer size in bytes.
Buffer & operator=(const Buffer &)=delete
Buffer(std::size_t nbytes, Environment environment=Host{})
Constructs a buffer with specified size and environment.
void * address()
Gets writable pointer to memory.
Buffer & operator=(Buffer &&other) noexcept
Move assignment transfers ownership.
Environment const & environment() const
Gets the environment used for this buffer.
Host memory domain.
Definition: resources.hpp:60
Definition: buffer.hpp:41
std::variant< Host, Device > Environment
Memory environment variant type.
Definition: resources.hpp:204