1 #ifndef SKA_CHEETAH_DATA_CUDA_SERIES_H 2 #define SKA_CHEETAH_DATA_CUDA_SERIES_H 4 #include "cheetah/data/Series.h" 5 #include "cheetah/cuda_utils/cuda_thrust.h" 6 #include <panda/arch/nvidia/DeviceCopy.h> 13 template <
typename ValueType,
typename Alloc>
14 class Series<cheetah::Cuda, ValueType, Alloc>:
public VectorLike<thrust::device_vector<ValueType,Alloc>>
17 #if __CUDACC_VER_MAJOR__ > 10 || (__CUDACC_VER_MAJOR__ == 10 && __CUDACC_VER_MINOR__ >= 2) 18 #define __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 20 typedef VectorLike<thrust::device_vector<ValueType,Alloc>> BaseT;
23 typedef cheetah::Cuda ArchitectureType;
24 typedef Alloc Allocator;
27 Series(std::size_t
size)
32 template<
typename OtherArch,
typename OtherAlloc>
33 Series(Series<OtherArch, ValueType, OtherAlloc>
const& copy)
36 panda::copy(copy.begin(), copy.end(), this->
begin());
39 Series(std::size_t
size, Allocator
const& allocator)
40 #ifdef __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 41 : BaseT(size, allocator)
43 #else // __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 47 #endif // __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 54 template<
typename OtherArch,
typename OtherAlloc>
55 Series(Series<OtherArch, ValueType, OtherAlloc>
const& copy, Alloc
const& allocator=Alloc())
56 #ifdef __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 57 : BaseT(copy.size(), allocator)
59 #else // __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 63 #endif // __NVCC_THRUST_SUPPORTS_ALLOCATOR_CONSTRUCTORS__ 64 thrust::copy(copy.begin(), copy.end(), this->
begin());
74 #endif // SKA_CHEETAH_DATA_CUDA_SERIES_H Some limits and constants for FLDO.
ConstIterator begin() const
Iterators to device memory.
std::size_t size() const
the size of the series