-
Notifications
You must be signed in to change notification settings - Fork 565
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
Kokkos: RELOCATABLE_DEVICE_CODE and desul atomics #13321
Comments
I can get my program to compile by commenting out line 25,
in packages/kokkos/tpls/desul/include/desul/atomics/Macros.hpp, Above this line is the comment,
Since ODR violations would lead to a compile-time or link-time error, and I do not see one, is this line still needed? Another indicator is that this error is raised in the above file only when one of DESUL_ATOMICS_ENABLE_CUDA_SEPARABLE_COMPILATION and DESUL_IMPL_CUDA_RDC is defined while the other is not. But DESUL_IMPL_CUDA_RDC appears nowhere else in the source, it seems, from
|
The fact your build produced an executable definitely does not mean there were no ODR violations. You are getting this error because Kokkos/Trilinos was built with RDC enabled and you attempt to build your code without the proper compiler flag to enable RDC. |
So should I add '-rdc' to CMAKE_CXX_FLAGS? Or maybe to CMAKE_CUDA_FLAGS? |
If you register your target dependency on Kokkos, your should get the proper flags transitively. |
I do, eg,
should I do something different? |
No, that is correct, that's what we want you to do. |
I remember now the problem. We make a clean distinction between C++ code (to be compiled by the C++ compiler) and CUDA code (to be compiled by nvcc or the wrapper). When we add Kokkos::all_libs, we then get, eg, a bunch of cuda flags put into the C++ flags, and then the compiler errors out. So including Kokkos in this way prevents us from having our separation, which we find useful and more maintainable.
Now I see that we have to get those back in for when we compile our cuda code. |
Bug Report
@kokkos
Description
RELOCATABLE_DEVICE_CODE and desul atomics
We use trilinos-15.1.1 in a project with separable CUDA compilation, for which I understand that we need to use relocatable device code (-DKokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE=TRUE). But when we do that and we compile our own code, we run into
#error Relocatable device code mode incompatible with desul atomics configuration
from packages/kokkos/tpls/desul/include/desul/atomics/Macros.hpp.
Is there a way around this?
Steps to Reproduce
vcloud.txcorp.com-tximplicit-ser-config.sh.txt
]
vcloud.txcorp.com-tximplicit-ser-config.txt
e]
vcloud.txcorp.com-tximplicit-ser-build.sh.txt
e]
The text was updated successfully, but these errors were encountered: