我正在尝试使用GCC 6.2.1构建一些CUDA代码,这是我发行版的默认编译器(注意:这不是CUDA官方支持的GCC版本,因此可以称之为实验性质)。这段代码在GCC 4.9.3和CUDA 7.5以及8.0版本中都能成功构建。
好的,如果我构建以下(接近)最小示例:
我遇到了以下错误:
为什么会这样?我该如何纠正/规避这个问题?
好的,如果我构建以下(接近)最小示例:
#include <tuple>
int main() { return 0; }
使用命令行
nvcc -std=c++11 -Wno-deprecated-gpu-targets -o main main.cu
我遇到了以下错误:
/usr/local/cuda/bin/../targets/x86_64-linux/include/math_functions.h(8897): error: cannot overload functions distinguished by return type alone
/usr/local/cuda/bin/../targets/x86_64-linux/include/math_functions.h(8901): error: cannot overload functions distinguished by return type alone
2 errors detected in the compilation of "/tmp/tmpxft_000071fe_00000000-9_b.cpp1.ii".
为什么会这样?我该如何纠正/规避这个问题?