Celeritas
0.5.0-56+6b053cd
|
Allocate pinned host memory when using a device. More...
#include <PinnedAllocator.hh>
Public Types | |
using | value_type = T |
Public Member Functions | |
CELER_FORCEINLINE T * | allocate (std::size_t count) |
CELER_FORCEINLINE void | deallocate (T *ptr, std::size_t) noexcept |
Allocate pinned host memory when using a device.
Satisfies the Allocator named requirement.
If Celeritas is built without device support, or if the device is disabled at runtime (including if this is called before the device is initialized!), the allocator will fall back to global
. Only use this when necessary (i.e. asynchronous H<->D memory transfer is needed) as pinned memory reduces the memory available to the systems.