Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Enumerations | Functions
hostallocator.h File Reference
#include <cstddef>
#include <memory>
#include "gromacs/math/paddedvector.h"
#include "gromacs/utility/alignedallocator.h"
#include "gromacs/utility/exceptions.h"
+ Include dependency graph for hostallocator.h:
+ This graph shows which files directly or indirectly include this file:


Declares gmx::HostAllocationPolicy, gmx::HostAllocator, gmx::HostVector and gmx::PaddedHostVector, which are used to make/be standard library containers that can allocate memory suitable for transfers. Currently the only supported transfers using pinned memory are to CUDA GPUs, but other possibilities exist in future.

This should not be in the public API, but it needs to be for the moment because state.h is in that API.
Mark Abraham


template<class T >
using gmx::HostAllocator = Allocator< T, HostAllocationPolicy >
 Memory allocator that uses HostAllocationPolicy. More...
template<class T >
using gmx::HostVector = std::vector< T, HostAllocator< T >>
 Convenience alias for std::vector that uses HostAllocator.
template<class T >
using gmx::PaddedHostVector = PaddedVector< T, HostAllocator< T >>
 Convenience alias for PaddedVector that uses HostAllocator.


enum  gmx::PinningPolicy : int { CannotBePinned, PinnedIfSupported }
 Helper enum for pinning policy of the allocation of HostAllocationPolicy. More...


template<class T1 , class T2 >
bool gmx::operator== (const Allocator< T1, HostAllocationPolicy > &a, const Allocator< T2, HostAllocationPolicy > &b)
 Return true if two allocators are identical. More...
template<typename PinnableVector >
void gmx::changePinningPolicy (PinnableVector *v, PinningPolicy pinningPolicy)
 Helper function for changing the pinning policy of a pinnable vector. More...