1 #ifndef hamr_hip_malloc_allocator_h
2 #define hamr_hip_malloc_allocator_h
4 #include "hamr_config.h"
12 template <
typename T,
typename E =
void>
17 class HAMR_EXPORT
hip_malloc_deleter<T, typename std::enable_if<!std::is_arithmetic<T>::value>::type>
30 void operator()(T *ptr);
44 class HAMR_EXPORT
hip_malloc_deleter<T, typename std::enable_if<std::is_arithmetic<T>::value>::type>
57 void operator()(T *ptr);
70 template <
typename T,
typename E =
void>
82 static std::shared_ptr<T> allocate(
size_t n);
90 static std::shared_ptr<T> allocate(
size_t n,
const T &val);
100 template <
typename U>
101 static std::shared_ptr<T> allocate(
size_t n,
const U *vals,
bool hipVals =
false);
109 template <
typename T>
117 static std::shared_ptr<T> allocate(
size_t n);
125 static std::shared_ptr<T> allocate(
size_t n,
const T &val);
135 template <
typename U>
136 static std::shared_ptr<T> allocate(
size_t n,
const U *vals,
bool hipVals =
false);
141 #if !defined(HAMR_SEPARATE_IMPL)
142 #include "hamr_hip_malloc_allocator_impl.h"