NVCC unable to compile multi_arrays
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the minimal example from main.cu with the shown NVCC command, then inspect boost/multi_array/base.hpp around lines 408 and 414 where NVCC reports syntax errors. Compare the .cu and .cpp compilation paths; done means the minimal multi_array declaration compiles in a .cu file with NVCC.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C++
- Stars
- 32
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/multi_array
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
boostorg/multi_array#38 · 2 comments · 1 reaction ·
-
boostorg/multi_array#35 · 2 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
boostorg/multi_array#33 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
boostorg/multi_array#32 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
boostorg/multi_array#31 · 2 comments ·
All issues in boostorg/multi_array
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·