Go to the documentation of this file.
16 #include <thrust/version.h>
17 #include <thrust/host_vector.h>
18 #include <thrust/device_vector.h>
19 #include <thrust/device_ptr.h>
21 #define COMPILE_CUDA // RSS Cant' we make this depend on THRUST_CUDA_BACKEND?
22 #ifdef THRUST_BACKEND_CUDA
23 #include <cuda_runtime.h>
40 #if (defined(WIN32) || defined(WIN64))
44 inline void progressStart(
const std::string &msg,
int steps) {}
47 inline void progStop() {}
64 #if THRUST_VERSION >= 100600
65 typedef thrust::counting_iterator<int, thrust::device_system_tag>
DCountIter;
67 typedef thrust::counting_iterator<int, thrust::device_space_tag>
DCountIter;
78 #define MByte size_t(1024 * 1024)
81 template <
typename T> T*
devP(thrust::device_vector<T> &DVec) {
return (&DVec[0]).get(); }
82 template <
typename T> T*
devP(thrust::device_vector<T> *DVec) {
return (&(*DVec)[0]).get(); }
85 #ifdef THRUST_BACKEND_CUDA
89 unsigned long long int* address_as_ull = (
unsigned long long int*)address;
90 unsigned long long int old = *address_as_ull, assumed;
93 old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val + __longlong_as_double(assumed)));
94 }
while (assumed != old);
95 return __longlong_as_double(old);
110 extern size_t memLeft(
size_t memrq,
size_t roomrq,
size_t mem);
111 extern int errMsg(
const std::string &s);
thrust::device_ptr< int > DevicePi
cuda_EXPORT uint getThreadCount(uint threadPos, uint totThreads)
void progressSetMsg(const std::string &msg)
cuda_EXPORT int errMsg(const std::string &s)
thrust::device_ptr< uint > DevicePui
Distributed matrix library.
double atomicAddMGX(double *address, double val)
void progressStart(const std::string &msg, int steps)
T * devP(thrust::device_vector< T > &DVec)
size_t memLeft(size_t memrq, size_t roomrq, size_t mem)
cuda_EXPORT size_t userMem()
thrust::device_ptr< double > DevicePd
thrust::device_ptr< Matrix3d > DevicePM3d
thrust::counting_iterator< int, thrust::device_space_tag > DCountIter
thrust::device_ptr< Point3d > DeviceP3d
cuda_EXPORT int checkCudaError(const std::string &msg)