No way to control half-float definitions
Submitted by Jake Kesinger
Assigned to Nobody
Link to original bugzilla bug (#1590)
Version: 3.3 (current stable)
Description
We're trying to compile Eigen on a platform whose system headers have #define'd "FP32" for its own use, which means the "union FP32" in src/Core/arch/CUDA/Half.h causes compilation errors. I went looking for flags to control the inclusion of this, and was not able to. What worked for us is to add an #ifdef guard around some include statements in Eigen/Core:
diff --git a/Eigen/Core b/Eigen/Core
index c74340b..7846877 100644
--- a/Eigen/Core
+++ b/Eigen/Core
@@ -432,10 +432,12 @@ using std::ptrdiff_t;
#include "src/Core/arch/ZVector/Complex.h"
#endif
+#if defined EIGEN_CUDACC
// Half float support
#include "src/Core/arch/CUDA/Half.h"
#include "src/Core/arch/CUDA/PacketMathHalf.h"
#include "src/Core/arch/CUDA/TypeCasting.h"
+#endif
#include "src/Core/arch/CUDA/PacketMath.h"
#if defined EIGEN_VECTORIZE_CUDAThank you.