Celeritas  0.5.0-86+4a8eea4
Public Types | Public Member Functions | List of all members
celeritas::PinnedAllocator< T > Struct Template Reference

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
 

Detailed Description

template<class T>
struct celeritas::PinnedAllocator< T >

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

::operator new() or \c
::operator delete()

. Only use this when necessary (i.e. asynchronous H<->D memory transfer is needed) as pinned memory reduces the memory available to the systems.


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