diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-07-15 16:04:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-15 16:04:08 -0700 |
| commit | e59e5a417c1460f3cf3d3772d057ec4e7c2247d5 (patch) | |
| tree | 0fdd71c9533241768a9b4a38e3d739627f0e4a72 /ports/eigen3/fix-cuda-error.patch | |
| parent | fc761ebb72a40574200b6b99e81458ead68da12a (diff) | |
| download | vcpkg-e59e5a417c1460f3cf3d3772d057ec4e7c2247d5.tar.gz vcpkg-e59e5a417c1460f3cf3d3772d057ec4e7c2247d5.zip | |
[eigen3] Fix eigen3 and cuda compatibility issue (#12279)
* [eigen3] Fix eigen3 and cuda compatibility issue
* forgot to apply patch
* Update ports/eigen3/portfile.cmake
* Update ports/eigen3/portfile.cmake
Diffstat (limited to 'ports/eigen3/fix-cuda-error.patch')
| -rw-r--r-- | ports/eigen3/fix-cuda-error.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ports/eigen3/fix-cuda-error.patch b/ports/eigen3/fix-cuda-error.patch new file mode 100644 index 000000000..9123806df --- /dev/null +++ b/ports/eigen3/fix-cuda-error.patch @@ -0,0 +1,30 @@ +diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h +index 755e620..85e445b 100644 +--- a/Eigen/src/Core/arch/CUDA/Half.h ++++ b/Eigen/src/Core/arch/CUDA/Half.h +@@ -209,7 +209,11 @@ namespace half_impl { + // conversion steps back and forth. + + EIGEN_STRONG_INLINE __device__ half operator + (const half& a, const half& b) { ++#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000 ++ return __hadd(::__half(a), ::__half(b)); ++#else + return __hadd(a, b); ++#endif + } + EIGEN_STRONG_INLINE __device__ half operator * (const half& a, const half& b) { + return __hmul(a, b); +@@ -218,9 +222,13 @@ EIGEN_STRONG_INLINE __device__ half operator - (const half& a, const half& b) { + return __hsub(a, b); + } + EIGEN_STRONG_INLINE __device__ half operator / (const half& a, const half& b) { ++#if defined(EIGEN_CUDACC_VER) && EIGEN_CUDACC_VER >= 90000 ++ return __hdiv(a, b); ++#else + float num = __half2float(a); + float denom = __half2float(b); + return __float2half(num / denom); ++#endif + } + EIGEN_STRONG_INLINE __device__ half operator - (const half& a) { + return __hneg(a); |
