errors in `EmulateArray.h` when compiling with nvcc
Summary
Since this commit a simple file doesn't compile when using nvcc
due to errors in Eigen/src/Core/util/EmulateArray.h
.
Environment
- Operating System : Linux
- Architecture : x64
- Eigen Version : master branch
- CUDA Version : 11.5 to 12.1
Steps to reproduce the error
file test.cc
:
#include <Eigen/Core>
int main(){return 0;}
compile with: nvcc -x cu -std=c++17 -O3 -isystem eigen test.cc -o test
the errors with CUDA versions 11.5-11.8 are:
eigen/Eigen/src/Core/util/EmulateArray.h(233): error: a template argument list is not allowed in a declaration of a primary template
eigen/Eigen/src/Core/util/EmulateArray.h(236): error: a template argument list is not allowed in a declaration of a primary template
eigen/Eigen/src/Core/util/EmulateArray.h(239): error: a template argument list is not allowed in a declaration of a primary template
eigen/Eigen/src/Core/util/EmulateArray.h(242): error: a template argument list is not allowed in a declaration of a primary template
with CUDA 12.0-12.1:
eigen/Eigen/src/Core/util/EmulateArray.h(56): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(58): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(80): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(81): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(85): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(86): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(91): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(92): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(99): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(100): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(108): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(109): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(118): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(119): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(129): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(130): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(142): error: identifier "YOU_MADE_A_PROGRAMMING_MISTAKE" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(143): error: expected a ";"
eigen/Eigen/src/Core/util/EmulateArray.h(156): error: namespace "Eigen::internal" has no member "smart_copy"
eigen/Eigen/src/Core/util/EmulateArray.h(166): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(171): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(177): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(182): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(187): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(192): error: identifier "eigen_plain_assert" is undefined
eigen/Eigen/src/Core/util/EmulateArray.h(233): error: a template argument list is not allowed in a declaration of a primary template
eigen/Eigen/src/Core/util/EmulateArray.h(236): error: a template argument list is not allowed in a declaration of a primary template
eigen/Eigen/src/Core/util/EmulateArray.h(239): error: a template argument list is not allowed in a declaration of a primary template
eigen/Eigen/src/Core/util/EmulateArray.h(242): error: a template argument list is not allowed in a declaration of a primary template
What is the expected correct behavior?
before the commit linked at the beginning it compiled with all CUDA versions.