Fix preprocessor condition to only generate a warning when calling eigen::GpuDevice::synchronize() from device code, but not when calling from a non-GPU compilation unit.

This commit is contained in:
Rasmus Munk Larsen 2019-06-28 11:56:21 -07:00
parent 70d4020ad9
commit 74a9dd1102

View File

@ -283,7 +283,7 @@ struct GpuDevice {
} }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void synchronize() const { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void synchronize() const {
#if defined(EIGEN_GPUCC) && !defined(EIGEN_GPU_COMPILE_PHASE) #ifndef EIGEN_GPU_COMPILE_PHASE
gpuError_t err = gpuStreamSynchronize(stream_->stream()); gpuError_t err = gpuStreamSynchronize(stream_->stream());
if (err != gpuSuccess) { if (err != gpuSuccess) {
std::cerr << "Error detected in GPU stream: " std::cerr << "Error detected in GPU stream: "