1 #ifndef hamr_cuda_malloc_async_allocator_h
2 #define hamr_cuda_malloc_async_allocator_h
4 #include "hamr_config.h"
13 template <
typename T,
typename E =
void>
32 void operator()(T *ptr);
37 const cudaStream_t m_str;
62 void operator()(T *ptr);
79 template <
typename T,
typename E =
void>
96 static std::shared_ptr<T> allocate(cudaStream_t str,
size_t n) HAMR_EXPORT;
106 static std::shared_ptr<T> allocate(cudaStream_t str,
size_t n,
const T &val) HAMR_EXPORT;
118 template <
typename U>
119 static std::shared_ptr<T> allocate(cudaStream_t str,
120 size_t n,
const U *vals,
bool cudaVals =
false) HAMR_EXPORT;
131 template <
typename T>
141 static std::shared_ptr<T> allocate(cudaStream_t str,
size_t n) HAMR_EXPORT;
151 static std::shared_ptr<T> allocate(cudaStream_t str,
size_t n,
const T &val) HAMR_EXPORT;
163 template <
typename U>
164 static std::shared_ptr<T> allocate(cudaStream_t str,
size_t n,
const U *vals,
bool cudaVals =
false) HAMR_EXPORT;
169 #if !defined(HAMR_SEPARATE_IMPL)
170 #include "hamr_cuda_malloc_async_allocator_impl.h"