forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eigen3] Fix eigen3 and cuda compatibility issue (microsoft#12279)
* [eigen3] Fix eigen3 and cuda compatibility issue * forgot to apply patch * Update ports/eigen3/portfile.cmake * Update ports/eigen3/portfile.cmake
Showing
3 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Source: eigen3 | ||
Version: 3.3.7-5 | ||
Version: 3.3.7 | ||
Port-Version: 6 | ||
Homepage: http://eigen.tuxfamily.org | ||
Description: C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters