rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
buffer.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/platform/dynamic_shared_object.h>
6
7#include <utility>
8#include <memory>
9#include <cstddef>
10
11namespace rexlib
12{
13
14class memory_resource;
15class memory_allocator;
16
24class REXLIB_API buffer
25{
26public:
27 buffer() noexcept;
28 buffer(const buffer &other) = delete;
29 buffer(buffer &&other) noexcept = delete;
30 virtual ~buffer();
31
32 buffer& operator=(const buffer &other) = delete;
33 buffer& operator=(buffer &&other) noexcept = delete;
34
54 virtual void* get_host_ptr() noexcept = 0;
55
66 virtual const void* get_host_ptr() const noexcept = 0;
67
76 virtual std::size_t get_size() const noexcept = 0;
77
83 virtual const memory_resource& get_memory_resource() const noexcept = 0;
84};
85
86} // namespace rexlib
Represents an untyped memory allocation at a given memory resource.
Definition buffer.hpp:25
virtual void * get_host_ptr() noexcept=0
Get a host accessible pointer to the data.
Abstract description of a physical memory region.
Definition memory_resource.hpp:21
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10