From 74a9dd11022b58685de29230f5cf69067bd7fbd4 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Fri, 28 Jun 2019 11:56:21 -0700 Subject: [PATCH] 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. --- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h index ebf85c072..5b1abdc40 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h @@ -283,7 +283,7 @@ struct GpuDevice { } 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()); if (err != gpuSuccess) { std::cerr << "Error detected in GPU stream: "