11 #ifndef CUBBYFLOW_THRUST_UTILS_HPP 12 #define CUBBYFLOW_THRUST_UTILS_HPP 14 #ifdef CUBBYFLOW_USE_CUDA 18 #include <cuda_runtime.h> 20 #include <thrust/device_ptr.h> 27 template <
typename T,
size_t N,
typename D>
28 thrust::device_ptr<T> thrustBegin(CUDAArrayBase<T, N, D>& arr)
30 return thrust::device_ptr<T>(arr.data());
33 template <
typename T,
size_t N,
typename D>
34 thrust::device_ptr<const T> thrustCBegin(
const CUDAArrayBase<T, N, D>& arr)
36 return thrust::device_ptr<const T>(arr.data());
39 template <
typename T,
size_t N,
typename D>
40 thrust::device_ptr<T> thrustEnd(CUDAArrayBase<T, N, D>& arr)
42 return thrust::device_ptr<T>(arr.data() + arr.Length());
45 template <
typename T,
size_t N,
typename D>
46 thrust::device_ptr<const T> thrustCEnd(
const CUDAArrayBase<T, N, D>& arr)
48 return thrust::device_ptr<const T>(arr.data() + arr.Length());
Definition: pybind11Utils.hpp:20