24 #ifndef TILEDARRAY_CUDA_THRUST_H__INCLUDED
25 #define TILEDARRAY_CUDA_THRUST_H__INCLUDED
27 #include <TiledArray/config.h>
29 #ifdef TILEDARRAY_HAS_CUDA
31 #include <cuda_runtime_api.h>
32 #include <thrust/device_vector.h>
33 #include <thrust/host_vector.h>
41 #if CUDART_VERSION < 10000
43 using device_allocator = thrust::device_malloc_allocator<T>;
46 template <
typename T,
typename Alloc>
47 const T* data(
const thrust::device_vector<T, Alloc>& dev_vec) {
48 return thrust::raw_pointer_cast(dev_vec.data());
50 template <
typename T,
typename Alloc>
51 T* data(thrust::device_vector<T, Alloc>& dev_vec) {
52 return thrust::raw_pointer_cast(dev_vec.data());
56 template <
typename T,
typename Alloc>
57 void resize(thrust::device_vector<T, Alloc>& dev_vec,
size_t size);
60 #endif // TILEDARRAY_HAS_CUDA
62 #endif // TILEDARRAY_CUDA_THRUST_H__INCLUDED