Discussion:
[eigen] PATCH: Guard CUDA includes with EIGEN_CUDACC
Anush Elangovan
2018-06-15 04:13:33 UTC
Permalink
Please find attached a patch that prevents compiling Eigen on an embedded
platform because some CUDA headers were not guarded and collided with
native types.

PS: Posting here because I gave up trying to figure out bitbucket's UI and
hg's issues with submitting a pull request. The patch is also on github at
https://github.com/powderluv/eigen/commit/9377c80050d62c1b3c250fdf395ecfbd9cb15afc

Thanks
Anush
Gael Guennebaud
2018-07-18 11:56:15 UTC
Permalink
Hi,

sorry for late reply. The handling of CUDA has been significantly changed
recently in the default branch. If there is still compilation issues,
please post here the exact compilation error so that we can properly fix
them. For instance, there should be no problem in including Half.h and the
likes without CUDA.

gael
Post by Anush Elangovan
Please find attached a patch that prevents compiling Eigen on an embedded
platform because some CUDA headers were not guarded and collided with
native types.
PS: Posting here because I gave up trying to figure out bitbucket's UI and
hg's issues with submitting a pull request. The patch is also on github at
https://github.com/powderluv/eigen/commit/9377c80050d62c1b3c250fdf395ecfbd9cb15afc
Thanks
Anush
Anush Elangovan
2018-07-21 20:48:35 UTC
Permalink
Gael,
This is still a problem in top of master. CPU half float support is
provided by code in Core/arch/GPU.

Thanks
Anush
Post by Gael Guennebaud
Hi,
sorry for late reply. The handling of CUDA has been significantly changed
recently in the default branch. If there is still compilation issues,
please post here the exact compilation error so that we can properly fix
them. For instance, there should be no problem in including Half.h and the
likes without CUDA.
gael
Post by Anush Elangovan
Please find attached a patch that prevents compiling Eigen on an embedded
platform because some CUDA headers were not guarded and collided with
native types.
PS: Posting here because I gave up trying to figure out bitbucket's UI
and hg's issues with submitting a pull request. The patch is also on github
at https://github.com/powderluv/eigen/commit/
9377c80050d62c1b3c250fdf395ecfbd9cb15afc
Thanks
Anush
Gael Guennebaud
2018-07-23 13:02:28 UTC
Permalink
yes, but what are the true errors? Without CUDA, those files should still
be usable (for instance I can build on ARM device with nothing cuda related
installed). At some point we'll have to cleanup those files to move the
generic/SSE/AVX parts to somewhere else, like util/half.h, arch/AVX/half.h,
etc.

gael
Post by Anush Elangovan
Gael,
This is still a problem in top of master. CPU half float support is
provided by code in Core/arch/GPU.
Thanks
Anush
On Wed, Jul 18, 2018 at 4:56 AM, Gael Guennebaud <
Post by Gael Guennebaud
Hi,
sorry for late reply. The handling of CUDA has been significantly changed
recently in the default branch. If there is still compilation issues,
please post here the exact compilation error so that we can properly fix
them. For instance, there should be no problem in including Half.h and the
likes without CUDA.
gael
Post by Anush Elangovan
Please find attached a patch that prevents compiling Eigen on an
embedded platform because some CUDA headers were not guarded and collided
with native types.
PS: Posting here because I gave up trying to figure out bitbucket's UI
and hg's issues with submitting a pull request. The patch is also on github
at
https://github.com/powderluv/eigen/commit/9377c80050d62c1b3c250fdf395ecfbd9cb15afc
Thanks
Anush
Lorenzo Botti
2018-07-26 16:41:19 UTC
Permalink
I don't know if this is somehow related... but i get this


***@digihabia:~/src/tools/cudaT$ nvcc
-I/home/ihabia/src2/eigen-eigen-3.3.5/ --expt-relaxed-constexpr test.cu
/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(96):
error: no operator "&" matches these operands
operand types are: const Eigen::half & int

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(136):
error: identifier "x" is undefined

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(136):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(221):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(221):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(274):
error: class "__half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(370):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(376):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(385):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(385):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(569):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(569):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(601):
error: class "Eigen::half" has no member "x"

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/Half.h(612):
warning: function "__shfl_xor(float, int, int)"
/usr/include/sm_30_intrinsics.hpp(295): here was declared deprecated
("__shfl_xor() is deprecated in favor of __shfl_xor_sync() and may be
removed in a future release (Use -Wno-deprecated-declarations to suppress
this warning).")

/home/ihabia/src2/eigen-eigen-3.3.5/Eigen/src/Core/arch/CUDA/PacketMathHalf.h(102):
error: more than one conversion function from "const __half" to a built-in
type applies:
function "__half::operator short() const"
function "__half::operator unsigned short() const"
function "__half::operator int() const"
function "__half::operator unsigned int() const"
function "__half::operator long long() const"
function "__half::operator unsigned long long() const"
function "__half::operator __nv_bool() const"

14 errors detected in the compilation of
"/tmp/tmpxft_000017c8_00000000-8_test.cpp1.ii".


Il giorno lun 23 lug 2018 alle ore 15:03 Gael Guennebaud <
Post by Gael Guennebaud
yes, but what are the true errors? Without CUDA, those files should still
be usable (for instance I can build on ARM device with nothing cuda related
installed). At some point we'll have to cleanup those files to move the
generic/SSE/AVX parts to somewhere else, like util/half.h, arch/AVX/half.h,
etc.
gael
Post by Anush Elangovan
Gael,
This is still a problem in top of master. CPU half float support is
provided by code in Core/arch/GPU.
Thanks
Anush
On Wed, Jul 18, 2018 at 4:56 AM, Gael Guennebaud <
Post by Gael Guennebaud
Hi,
sorry for late reply. The handling of CUDA has been significantly
changed recently in the default branch. If there is still compilation
issues, please post here the exact compilation error so that we can
properly fix them. For instance, there should be no problem in including
Half.h and the likes without CUDA.
gael
Post by Anush Elangovan
Please find attached a patch that prevents compiling Eigen on an
embedded platform because some CUDA headers were not guarded and collided
with native types.
PS: Posting here because I gave up trying to figure out bitbucket's UI
and hg's issues with submitting a pull request. The patch is also on github
at
https://github.com/powderluv/eigen/commit/9377c80050d62c1b3c250fdf395ecfbd9cb15afc
Thanks
Anush
Loading...