rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::memory_resource Class Referenceabstract

Abstract description of a physical memory region. More...

#include <rexlib/core/hardware/memory_resource.hpp>

Public Member Functions

 memory_resource (const memory_resource &other)=delete
 
 memory_resource (memory_resource &&other)=delete
 
memory_resource & operator= (const memory_resource &other)=delete
 
memory_resource & operator= (memory_resource &&other)=delete
 
virtual memory_resource_kind get_kind () const noexcept=0
 Get the kind of memory this resource represents.
 
virtual std::shared_ptr< memory_allocator > create_allocator () const =0
 Create an allocator that produces buffers on this resource.
 

Detailed Description

Abstract description of a physical memory region.

Member Function Documentation

◆ create_allocator()

virtual std::shared_ptr< memory_allocator > rexlib::memory_resource::create_allocator ( ) const
pure virtual

Create an allocator that produces buffers on this resource.

Some implementations may choose to always return the same allocator object (singleton-like).

Returns
The new allocator. Never null.

◆ get_kind()

virtual memory_resource_kind rexlib::memory_resource::get_kind ( ) const
pure virtualnoexcept

Get the kind of memory this resource represents.

The returned value is constant over the lifetime of the resource and determines the host/device accessibility of the buffers allocated from it (see is_host_accessible and is_device_accessible).

Returns
Kind tag describing this resource.

The documentation for this class was generated from the following file: