Vladimir Florinski
2018-09-13 00:06:23 UTC
I hope one of the developers could help me with using Eigen in CUDA code. I
am using version 9.1 of the CUDA toolkit and Eigen 3.3.5. This simple code
#include <cuda_runtime.h>
#include <Eigen/Dense>
__device__ void EigenMVCuda(Eigen::MatrixXd& mat, Eigen::VectorXd& vec,
Eigen::VectorXd& res)
{
res = mat * vec;
};
int main() {};
Generates the following type of errors:
../include/Eigen/src/Core/MathFunctions.h(1067): warning: calling a
__host__ function from a __host__ __device__ function is not allowed
../include/Eigen/src/Core/arch/CUDA/Half.h(96): error: identifier "x" is
undefined
../include/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"
Looks like there are three different issues here, but I am not sufficiently
familiar with the inner workings of either library to make much sense out
of them. Please advise how to resolve.
Thanks,
am using version 9.1 of the CUDA toolkit and Eigen 3.3.5. This simple code
#include <cuda_runtime.h>
#include <Eigen/Dense>
__device__ void EigenMVCuda(Eigen::MatrixXd& mat, Eigen::VectorXd& vec,
Eigen::VectorXd& res)
{
res = mat * vec;
};
int main() {};
Generates the following type of errors:
../include/Eigen/src/Core/MathFunctions.h(1067): warning: calling a
__host__ function from a __host__ __device__ function is not allowed
../include/Eigen/src/Core/arch/CUDA/Half.h(96): error: identifier "x" is
undefined
../include/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"
Looks like there are three different issues here, but I am not sufficiently
familiar with the inner workings of either library to make much sense out
of them. Please advise how to resolve.
Thanks,
--
Vladimir Florinski
Vladimir Florinski