vecmem 1.14.0
Loading...
Searching...
No Matches
memory_resource_base.hpp
1/* VecMem project, part of the ACTS project (R&D line)
2 *
3 * (c) 2021-2023 CERN for the benefit of the ACTS project
4 *
5 * Mozilla Public License Version 2.0
6 */
7#pragma once
8
9// Local include(s).
10#include "vecmem/memory/memory_resource.hpp"
11#include "vecmem/utils/sycl/queue_wrapper.hpp"
12#include "vecmem/vecmem_sycl_export.hpp"
13
15namespace vecmem::sycl::details {
16
22class memory_resource_base : public memory_resource {
23
24public:
31
32protected:
35
36private:
39
42 virtual void do_deallocate(void* ptr, std::size_t nbytes,
43 std::size_t alignment) override final;
44
47 virtual bool do_is_equal(
48 const memory_resource& other) const noexcept override final;
49
51
52}; // memory_resource_base
53
54} // namespace vecmem::sycl::details
SYCL memory resource base class.
Definition memory_resource_base.hpp:22
VECMEM_SYCL_EXPORT memory_resource_base(const queue_wrapper &queue={})
Constructor on top of a user-provided queue.
VECMEM_SYCL_EXPORT ~memory_resource_base()
Destructor.
queue_wrapper m_queue
The queue that the allocations are made for/on.
Definition memory_resource_base.hpp:34
virtual VECMEM_SYCL_EXPORT void do_deallocate(void *ptr, std::size_t nbytes, std::size_t alignment) override final
Function performing the memory de-allocation.
virtual VECMEM_SYCL_EXPORT bool do_is_equal(const memory_resource &other) const noexcept override final
Function comparing two memory resource instances.
Wrapper class for ::sycl::queue.
Definition queue_wrapper.hpp:23
Namespace for types that should not be used directly by clients.
Definition sycl_builtin_device_atomic_ref.hpp:18
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35