|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Host memory that stands in for device memory: host RAM that reports itself device-accessible. More...
#include <EBGeometry_MemoryResource.hpp>


Public Member Functions | |
| EmulatedDeviceMemoryResource ()=default | |
| Default constructor. | |
| ~EmulatedDeviceMemoryResource () override=default | |
| Destructor. | |
| void * | allocate (size_t a_bytes, size_t a_alignment) override |
| Allocate an aligned block of host memory. | |
| void | deallocate (void *a_ptr, size_t a_bytes, size_t a_alignment) noexcept override |
| Free a block previously returned by allocate. | |
| bool | isHostAccessible () const noexcept override |
| The blocks are host memory. | |
| bool | isDeviceAccessible () const noexcept override |
| The blocks report themselves device-accessible, which is what makes them stand in for device memory. | |
Public Member Functions inherited from EBGeometry::MemoryResource | |
| MemoryResource ()=default | |
| Default constructor. | |
| virtual | ~MemoryResource ()=default |
| Destructor. | |
| MemoryResource (const MemoryResource &)=delete | |
| Copy constructor. Deleted: a resource's identity is meaningful and non-copyable. | |
| MemoryResource & | operator= (const MemoryResource &)=delete |
| Copy assignment. Deleted: a resource's identity is meaningful and non-copyable. | |
| virtual void | copy (void *a_dst, const MemoryResource &a_dstResource, const void *a_src, const MemoryResource &a_srcResource, size_t a_bytes) const noexcept |
| Copy a block between memory from two resources, one of which is this one. | |
Host memory that stands in for device memory: host RAM that reports itself device-accessible.
Always compiled, on every backend. A pool mirrored into it is a host copy, but a rebasedView() onto that copy takes the device-view path (a snapshot of the location, no control block), exactly as it would onto a mirror in device memory. Code that mirrors, rebases and runs a query through GPU::transform() therefore runs unchanged in a plain C++ build, where GPU::transform() is a host loop. Use it through GPU::memoryResource(), which picks device memory in a CUDA or HIP build and this resource otherwise. Never hand memory from it to a real kernel: it is host memory.
|
overridevirtual |
Allocate an aligned block of host memory.
| [in] | a_bytes | Number of bytes to allocate. |
| [in] | a_alignment | Required alignment in bytes (power of two). |
Implements EBGeometry::MemoryResource.
|
overridevirtualnoexcept |
Free a block previously returned by allocate.
| [in] | a_ptr | Pointer to free (null is a no-op). |
| [in] | a_bytes | Size passed to allocate. |
| [in] | a_alignment | Alignment passed to allocate. |
Implements EBGeometry::MemoryResource.
|
inlineoverridevirtualnoexcept |
The blocks report themselves device-accessible, which is what makes them stand in for device memory.
Implements EBGeometry::MemoryResource.
|
inlineoverridevirtualnoexcept |