-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'J': is not a valid type for non-type template parameter 'J' #89
Comments
You will have to use the thrust adaptor: https://www.boost.org/doc/libs/1_86_0/libs/numeric/odeint/doc/html/boost_numeric_odeint/tutorial/using_cuda__or_openmp__tbb_______via_thrust.html. You cannot directly use NVCC since that would require all dependent libraries to support CUDA (which is the issue you are seeing pop up from Fusion). |
Thank you so much for your response! Could you explain me why this code works in Ubuntu using a CMakeLists.txt? I have included the CMakeLists that I am using. Thank you so much in advance.
|
Presumably Ubuntu is using GCC as the host compiler. Sometimes invalid code (e.g. not marked with |
I have been testing one of the Odeint examples, the Harmonic Oscillator: https://github.com/headmyshoulder/odeint-v2/blob/master/examples/harmonic_oscillator.cpp HarmonicOscillator:
C++:
CUDA:
|
You need to run one of the examples out of this folder: https://github.com/headmyshoulder/odeint-v2/tree/master/examples/thrust. The results are the same since no CUDA was used. |
Thank you for your continuous responses! My point is that even not using any CUDA code, the example does not compile on Window, but it does on Ubuntu. As you pointed out before, the host code must be compiled using the C++ compiler (this is why both outputs are the same) then I don't need to use Thrust because I don't have any CUDA code. I hope my point is clearer now. |
Unfortunately I have no experience with CUDA on windows. I have only ever run it on Ubuntu and Red Hat platforms. |
Ok no problem. I would like to thank you because you have been very kind! Have a great day! |
I have a brute force solution: boostorg/fusion#269 |
Hello,
I have been facing an issue using Boost Odeint with CUDA in Windows 11then I am going to include a MVCE using a .cu file:
Configurations:
-Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.11.0
-Nvidia Driver Version: 560.81
-CUDA Toolkit 12.6
-BOOST 1.86
-MVCE.cu
MVCE.cu:
Output:
Error C2334 unexpected token(s) preceding '{'; skipping apparent function body CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 246
2.Error C2993 'J': is not a valid type for non-type template parameter 'J' CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 236
Error C2062 type 'unknown-type' unexpected CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 236
Error C2334 unexpected token(s) preceding '{'; skipping apparent function body CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 239
5.Error C2993 'J': is not a valid type for non-type template parameter 'J' CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 243
6.Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 243
7.Error C2062 type 'unknown-type' unexpected CudaRuntime1 C:\Users\benny\Downloads\boost_1_86_0\boost\fusion\container\vector\vector.hpp 243
The first error refers to the use of a C++ version prior to C++ 20 but I have used C++ 20 and it is the same error.
On the other hand, if it is replaced "odeint" by "interval" then the code compiles properly.
Output:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 11:07 AM and took 01.917 seconds ==========
Finally, this code works properly in Ubuntu using CMake then it is not a general incompatibility between CUDA and BOOST.
*I have already published this error in fusion but I was referred to Odeint: boostorg/fusion#269
I hope you can help us with this issue. Thank you so much in advance! Let me know if there is something I can do to help you to fix this error.
The text was updated successfully, but these errors were encountered: