Commit 02c843d5 authored by Pierre NARVOR's avatar Pierre NARVOR
Browse files

[cuda] Added host/device definition for complex numbers

parent 4f64e0ca
......@@ -4,6 +4,7 @@
#include <iostream>
#include <sstream>
#include <cstring>
#include <complex>
#include <cuda_runtime.h>
......@@ -41,8 +42,25 @@
} \
} while(0) \
// Using NVIDIA thrust framework when compiling CUDA code.
#include <thrust/complex.h>
#endif //RTAC_CUDACC
namespace rtac { namespace cuda {
// Complex number definition : using thrust::complex when in CUDA device code
// (NVCC compiler) and std::complex when in host code (CPU side). Both are
// binary compatible (a buffer can be created an initialized on host side then
// uploaded to device and the other way around seamlessly).
template <typename T>
using Complex = thrust::complex<T>;
template <typename T>
using Complex = std::complex<T>;
#endif //RTAC_CUDACC
inline void init_cuda()
// CUDA will init on the first API call.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment