From 9341f258d4ee8a819c31cec8a9dc027a10669372 Mon Sep 17 00:00:00 2001 From: Hugh Perkins Date: Tue, 6 Jun 2017 15:51:06 +0100 Subject: Add labels to #ifdef, in TensorReductionCuda.h --- .../Eigen/CXX11/src/Tensor/TensorReductionCuda.h | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h index edb0ab280..24a55a3d5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h @@ -62,9 +62,9 @@ __device__ EIGEN_ALWAYS_INLINE void atomicReduce(T* output, T accum, R& reducer) else { assert(0 && "Wordsize not supported"); } -#else +#else // __CUDA_ARCH__ >= 300 assert(0 && "Shouldn't be called on unsupported device"); -#endif +#endif // __CUDA_ARCH__ >= 300 } // We extend atomicExch to support extra data types @@ -98,15 +98,15 @@ __device__ inline void atomicReduce(half2* output, half2 accum, R& reducer } } } -#endif +#endif // EIGEN_HAS_CUDA_FP16 template <> __device__ inline void atomicReduce(float* output, float accum, SumReducer&) { #if __CUDA_ARCH__ >= 300 atomicAdd(output, accum); -#else +#else // __CUDA_ARCH__ >= 300 assert(0 && "Shouldn't be called on unsupported device"); -#endif +#endif // __CUDA_ARCH__ >= 300 } @@ -179,9 +179,9 @@ __global__ void FullReductionKernel(Reducer reducer, const Self input, Index num // Let the last block reset the semaphore atomicInc(semaphore, gridDim.x + 1); } -#else +#else // __CUDA_ARCH__ >= 300 assert(0 && "Shouldn't be called on unsupported device"); -#endif +#endif // __CUDA_ARCH__ >= 300 } @@ -268,7 +268,7 @@ __global__ void ReductionCleanupKernelHalfFloat(Op& reducer, half* output, half2 *output = tmp; } -#endif +#endif // EIGEN_HAS_CUDA_FP16 template struct FullReductionLauncher { @@ -335,7 +335,7 @@ struct FullReductionLauncher { } } }; -#endif +#endif // EIGEN_HAS_CUDA_FP16 template @@ -348,11 +348,11 @@ struct FullReducer { (internal::is_same::value || internal::is_same::value || (internal::is_same::value && reducer_traits::PacketAccess)); -#else +#else // EIGEN_HAS_CUDA_FP16 static const bool HasOptimizedImplementation = !Op::IsStateful && (internal::is_same::value || internal::is_same::value); -#endif +#endif // EIGEN_HAS_CUDA_FP16 template static void run(const Self& self, Op& reducer, const GpuDevice& device, OutputType* output) { @@ -433,9 +433,9 @@ __global__ void InnerReductionKernel(Reducer reducer, const Self input, Index nu } } } -#else +#else // __CUDA_ARCH__ >= 300 assert(0 && "Shouldn't be called on unsupported device"); -#endif +#endif // __CUDA_ARCH__ >= 300 } #ifdef EIGEN_HAS_CUDA_FP16 @@ -533,7 +533,7 @@ __global__ void InnerReductionKernelHalfFloat(Reducer reducer, const Self input, } } -#endif +#endif // EIGEN_HAS_CUDA_FP16 template struct InnerReductionLauncher { @@ -625,7 +625,7 @@ struct InnerReductionLauncher { return false; } }; -#endif +#endif // EIGEN_HAS_CUDA_FP16 template @@ -638,11 +638,11 @@ struct InnerReducer { (internal::is_same::value || internal::is_same::value || (internal::is_same::value && reducer_traits::PacketAccess)); -#else +#else // EIGEN_HAS_CUDA_FP16 static const bool HasOptimizedImplementation = !Op::IsStateful && (internal::is_same::value || internal::is_same::value); -#endif +#endif // EIGEN_HAS_CUDA_FP16 template static bool run(const Self& self, Op& reducer, const GpuDevice& device, OutputType* output, typename Self::Index num_coeffs_to_reduce, typename Self::Index num_preserved_vals) { @@ -740,7 +740,7 @@ struct OuterReducer { } }; -#endif +#endif // defined(EIGEN_USE_GPU) && defined(__CUDACC__) } // end namespace internal -- cgit v1.2.3