Created attachment 778 [details] Minimal failing example Hi, I have observed this error when trying to check if two matrices are equal inside a CUDA kernel (see attached reproducer): <path>/main.cu(12): error: calling a __host__ function("Eigen::MatrixBase< ::Eigen::Matrix<float, (int)5, (int)3, (int)0, (int)5, (int)3> > ::operator ==< ::Eigen::Matrix<float, (int)5, (int)3, (int)0, (int)5, (int)3> > ") from a __global__ function("testEqual<(int)5, (int)3> ") is not allowed <path>/main.cu(28): error: calling a __host__ function("Eigen::MatrixBase< ::Eigen::Matrix<float, (int)5, (int)3, (int)0, (int)5, (int)3> > ::operator !=< ::Eigen::Matrix<float, (int)5, (int)3, (int)0, (int)5, (int)3> > ") from a __global__ function("testNotEqual<(int)5, (int)3> ") is not allowed This fails on both version 3.3.3 and the development version from the default branch. In Eigen/src/Core/MatrixBase.h lines 296-306 where both functions are defined, there is indeed no EIGEN_DEVICE_FUNC. Furthermore, it is also missing in Eigen/src/Core/DenseBase.h lines 487-488 where all() and any() are defined. Is there a reason why calling them is not allowed inside kernels? If not, I would suggest to add the EIGEN_DEVICE_FUNC qualifier and inline the definitions of all() and any(). Tested on (K)Ubuntu 14.04 and CUDA 8.0 using the attached example program. Kind regards, Patrick
This should be fixed in both devel and 3.3 branches.
I can confirm that the newest version of 3.3 and devel resolved the problem. Thank you.
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com'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: https://gitlab.com/libeigen/eigen/issues/1396.