From f268db1c4bd0510f13f0218205c2e135f2790175 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Fri, 19 Feb 2016 16:31:04 +0000 Subject: Added the ability to query the minor version of a cuda device --- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h index e684ab8f7..3808eb155 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h @@ -247,6 +247,14 @@ struct GpuDevice { return 0; #endif } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int minorDeviceVersion() const { +#ifndef __CUDA_ARCH__ + return stream_->deviceProperties().minor; +#else + eigen_assert(false && "The default device should be used instead to generate kernel code"); + return 0; +#endif + } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int maxBlocks() const { return max_blocks_; -- cgit v1.2.3