Gromacs
2024.3
|
#include <cstddef>
#include <memory>
#include "gromacs/math/paddedvector.h"
#include "gromacs/utility/alignedallocator.h"
#include "gromacs/utility/exceptions.h"
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.
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... | |