Celeritas 0.7+ab0b5d5
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | 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

Tallocate (std::size_t count)
 
void deallocate (T *ptr, std::size_t) noexcept
 

Friends

template<class U >
bool operator== (PinnedAllocator const &, PinnedAllocator< U > const &)
 
template<class U >
bool operator!= (PinnedAllocator const &, PinnedAllocator< U > const &)
 

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: