This bugzilla service is closed. All entries have been migrated to
Bug 1590 - No way to control half-float definitions
Summary: No way to control half-float definitions
Alias: None
Product: Eigen
Classification: Unclassified
Component: Interoperability (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Unknown
Assignee: Nobody
Depends on:
Reported: 2018-08-27 16:20 UTC by Jake Kesinger
Modified: 2019-12-04 17:53 UTC (History)
5 users (show)


Description Jake Kesinger 2018-08-27 16:20:32 UTC
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"
+#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"
   #include "src/Core/arch/CUDA/PacketMath.h"
Thank you.
Comment 1 Gael Guennebaud 2018-08-28 11:22:21 UTC
I renamed it in default and 3.3 branches:
Comment 2 Jake Kesinger 2018-08-28 13:37:10 UTC
Comment 3 Nobody 2019-12-04 17:53:08 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.