Re: [eigen] PATCH: Guard CUDA includes with EIGEN_CUDACC

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


I don't know if this is somehow related... but i get this


ihabia@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 <gael.guennebaud@xxxxxxxxx> ha scritto:
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

On Sat, Jul 21, 2018 at 10:48 PM Anush Elangovan <anush@xxxxxxx> wrote:
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 <gael.guennebaud@xxxxxxxxx> wrote:
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

On Fri, Jun 15, 2018 at 6:14 AM Anush Elangovan <anush@xxxxxxx> wrote:
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



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/