HAMR
The Heterogeneous Accelerator Memory Resource
hamr::new_allocator< T > Struct Template Reference

a class for allocating arrays with new More...

#include <hamr_new_allocator.h>

Static Public Member Functions

static std::shared_ptr< T > allocate (size_t n)
 
static std::shared_ptr< T > allocate (size_t n, const T &val)
 
template<typename U >
static std::shared_ptr< T > allocate (size_t n, const U *vals)
 

Detailed Description

template<typename T>
struct hamr::new_allocator< T >

a class for allocating arrays with new

Member Function Documentation

◆ allocate() [1/3]

template<typename T >
std::shared_ptr< T > hamr::new_allocator< T >::allocate ( size_t  n)
static

allocate an array of n elements.

Parameters
[in]nthe number of elements to allocate
Returns
a shared pointer to the array that holds a deleter for the memory

◆ allocate() [2/3]

template<typename T >
std::shared_ptr< T > hamr::new_allocator< T >::allocate ( size_t  n,
const T &  val 
)
static

allocate an array of n elements.

Parameters
[in]nthe number of elements to allocate
[in]vala value to initialize the elements to
Returns
a shared pointer to the array that holds a deleter for the memory

◆ allocate() [3/3]

template<typename T >
template<typename U >
std::shared_ptr< T > hamr::new_allocator< T >::allocate ( size_t  n,
const U *  vals 
)
static

allocate an array of n elements.

Parameters
[in]nthe number of elements to allocate
[in]valsan array of n values to initialize the elements with
Returns
a shared pointer to the array that holds a deleter for the memory

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