Eigen JacobiSVD compile error

Hi,
I’ve got an error, regarding calling JacobiSVD in my cuda function.

This is the part of the code that causing the error.
Eigen::JacobiSVDEigen::Matrix3d svd( cov_e, Eigen::ComputeThinU | Eigen::ComputeThinV);

And this is the error message.
CUDA_voxel_building.cu(43): error: calling a host function(“Eigen::JacobiSVD<Eigen::Matrix<double, (int)3, (int)3, (int)0, (int)3, (int)3> , (int)2> ::JacobiSVD”) from a global function(“kernel”) is not allowed

I’ve used the following command to compile it.
nvcc -std=c++11 -D_MWAITXINTRIN_H_INCLUDED -D__STRICT_ANSI__ -ptx CUDA_voxel_building.cu

I’m using cuda 8.0 with eigen3 on ubuntu 16.04.

Anyone knows a solution?

The cross-post on Stack Overflow has the answer: You can’t call a host function in device code. Solution: Call it from the host instead.