NVCC doesnt accept -std=c++11 flag so Eigen sets __cplusplus to 199711L and EIGEN_HAS_C99_MATH to 0. Further lgama,polygamma in specialFunctionsImpl.h requires c99/c++11 enabled hence causing compile time errors.
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(108): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(1007): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(1007): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(342): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(375): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(375): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(645): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(645): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(461): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(461): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(1056): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
I am using Cuda V8.0.44 and Eigen 3.3.4
// Needed for TensorContractionCuda.h
#define __CUDACC__
//Needed for TensorDeviceCuda.h
#define EIGEN_USE_GPU
cudaError_t cudaStatus;
float *_data1 = 0;
float *_data2 = 0;
float *_data3 = 0;
cudaStatus = cudaMallocManaged((void**)&_data1, 3*4* sizeof(float));
cudaStatus = cudaMallocManaged((void**)&_data2, 4*3* sizeof(float));
cudaStatus = cudaMallocManaged((void**)&_data3, 3*3* sizeof(float));
for (int i = 0; i < 3*4; i++) {
_data1[i] = ((float)rand()) / (float)RAND_MAX;
_data2[i] = ((float)rand()) / (float)RAND_MAX;
}
Eigen::TensorMap<Eigen::Tensor<float, 2>>input1(_data1, 3, 4);
Eigen::TensorMap<Eigen::Tensor<float, 2>> input2(_data2, 4, 3);
Eigen::TensorMap<Eigen::Tensor<float, 2>>output(_data3, 3, 3);
// SpecialFunctions/SpecialFunctionsImpl.h(1007): error : static assertion failed with "THIS_TYPE_IS_NOT_SUPPORTED"
Eigen::CudaStreamDevice stream;
Eigen::GpuDevice gpu_device(&stream);
Eigen::array<Eigen::IndexPair<int>, 1> dims = { Eigen::IndexPair<int>(1, 0) };
output.device(gpu_device) = input1.contract(input2, dims)
Aucun commentaire:
Enregistrer un commentaire