NVCC unable to compile multi_arrays
还没有人认领这个 Issue。
评估
调研方向
使用所示的 NVCC 命令复现 main.cu 中的最小示例,然后检查 boost/multi_array/base.hpp 中第 408 行和第 414 行附近的位置,NVCC 会在那里报告语法错误。比较 .cu 和 .cpp 的编译路径;当最小的 multi_array 声明能够在 .cu 文件中使用 NVCC 编译时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I am trying to use multi_arrays in a CUDA GPU project and NVCC is unable to compile it.
NVCC version is 12.3 (error also occurs with other versions)
Boost version is 1.84.0 (error also occurs with other versions)
I used the following command to compile:
nvcc -o C:/_repro/output.exe C:/_repro/main.cu -IC:/boost_1_84_0
I am using the following code (main.cu):
#include <boost/multi_array.hpp>
int main()
{
boost::multi_array<int, 3> my_arr;
return 0;
}
I get the following errors:
C:/boost_1_84_0\boost/multi_array/base.hpp(408): error C2988: unrecognizable template declaration/definition
C:/boost_1_84_0\boost/multi_array/base.hpp(408): error C2143: syntax error: missing ')' before '<'
C:/boost_1_84_0\boost/multi_array/base.hpp(408): error C2143: syntax error: missing ';' before '<'
C:/boost_1_84_0\boost/multi_array/base.hpp(408): error C2238: unexpected token(s) preceding ';'
C:/boost_1_84_0\boost/multi_array/base.hpp(408): error C2059: syntax error: '<'
C:/boost_1_84_0\boost/multi_array/base.hpp(414): error C2059: syntax error: ')'
C:/boost_1_84_0\boost/multi_array/base.hpp(494): error C2143: syntax error: missing ';' before '}'
C:/boost_1_84_0\boost/multi_array/base.hpp(494): error C2238: unexpected token(s) preceding ';'
Several more errors occur when I attempt to use further multi_array functionality such as extents and indexing, this is just a minimal example. Additionally, the code compiles just fine when you change the file extention to .cpp, but I assume this is just NVCC falling back on the default cl.exe compiler. I specifically need multi_arrays to compile within a .cu file along with CUDA device code.
Any help is much appreciated, thank you.
- 主要语言
- C++
- 星标
- 32
- 派生
- 39
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/multi_array 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
boostorg/multi_array#38 · 2 条评论 · 1 个 reaction ·
-
boostorg/multi_array#35 · 2 条评论 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 30/100
boostorg/multi_array#33 ·
-
难度 4/5 3-5 天 新手友好度 35/100
boostorg/multi_array#32 ·
-
难度 3/5 1-2 天 新手友好度 48/100
boostorg/multi_array#31 · 2 条评论 ·
查看 boostorg/multi_array 的全部 Issue
相似的 Issue
-
enhancement
难度 1/5 1 小时以内 新手友好度 88/100
QuantStack/git2cpp#187 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 1/5 1 小时以内 新手友好度 90/100
AXERA-TECH/ax-llm#77 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
games-on-whales/wolf#509 ·
-
难度 2/5 1-3 小时 新手友好度 82/100