From a20b58845f5f457375a91ec7e8acdeee2f920d33 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 3 Aug 2016 10:00:43 -0700 Subject: [PATCH] CUDA_ARCH isn't always defined, so avoid relying on it too much when figuring out which implementation to use for reductions. Instead rely on the device to tell us on which hardware version we're running. --- .../Eigen/CXX11/src/Tensor/TensorReductionCuda.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h index d3894e625..5e512490c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h @@ -336,11 +336,9 @@ struct FullReducer { static const bool HasOptimizedImplementation = !Op::IsStateful && (internal::is_same::value || (internal::is_same::value && reducer_traits::PacketAccess)); -#elif __CUDA_ARCH__ >= 300 +#else static const bool HasOptimizedImplementation = !Op::IsStateful && internal::is_same::value; -#else - static const bool HasOptimizedImplementation = false; #endif template @@ -619,11 +617,9 @@ struct InnerReducer { static const bool HasOptimizedImplementation = !Op::IsStateful && (internal::is_same::value || (internal::is_same::value && reducer_traits::PacketAccess)); -#elif __CUDA_ARCH__ >= 300 +#else static const bool HasOptimizedImplementation = !Op::IsStateful && internal::is_same::value; -#else - static const bool HasOptimizedImplementation = false; #endif template @@ -678,12 +674,8 @@ struct OuterReducer { // Unfortunately nvidia doesn't support well exotic types such as complex, // so reduce the scope of the optimized version of the code to the simple case // of floats. -#if __CUDA_ARCH__ >= 300 static const bool HasOptimizedImplementation = !Op::IsStateful && internal::is_same::value; -#else - static const bool HasOptimizedImplementation = false; -#endif template static EIGEN_DEVICE_FUNC bool run(const Self&, Op&, const Device&, OutputType*, typename Self::Index, typename Self::Index) {