1 #ifndef hamr_openmp_allocator_h
2 #define hamr_openmp_allocator_h
4 #include "hamr_config.h"
11 template <
typename T,
typename E =
void>
16 class HAMR_EXPORT
openmp_deleter<T, typename std::enable_if<!std::is_arithmetic<T>::value>::type>
29 void operator()(T *ptr);
44 class HAMR_EXPORT
openmp_deleter<T, typename std::enable_if<std::is_arithmetic<T>::value>::type>
57 void operator()(T *ptr);
72 template <
typename T,
typename E =
void>
77 struct HAMR_EXPORT
openmp_allocator<T, typename std::enable_if<!std::is_arithmetic<T>::value>::type>
83 static std::shared_ptr<T> allocate(
size_t n) HAMR_EXPORT;
91 static std::shared_ptr<T> allocate(
size_t n,
const T &val) HAMR_EXPORT;
99 static std::shared_ptr<T> allocate(
size_t n,
const U *vals) HAMR_EXPORT;
108 template <
typename T>
109 struct HAMR_EXPORT
openmp_allocator<T, typename std::enable_if<std::is_arithmetic<T>::value>::type>
115 static std::shared_ptr<T> allocate(
size_t n) HAMR_EXPORT;
122 static std::shared_ptr<T> allocate(
size_t n,
const T &val) HAMR_EXPORT;
129 template <
typename U>
130 static std::shared_ptr<T> allocate(
size_t n,
const U *vals) HAMR_EXPORT;
135 #if !defined(HAMR_SEPARATE_IMPL)
136 #include "hamr_openmp_allocator_impl.h"