Gromacs  2022.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | 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:

Description

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.

Todo:
This should not be in the public API, but it needs to be for the moment because state.h is in that API.
Author
Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Classes

class  gmx::HostAllocationPolicy
 Policy class for configuring gmx::Allocator, to manage allocations of memory that may be needed for e.g. GPU transfers. More...
 

Typedefs

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.
 

Enumerations

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

Functions

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...