After we merged #1544 which added a version check:
|
#ifdef __CUDACC__ |
|
#if __CUDACC_VER_MAJOR__ < 10 \ |
|
|| (__CUDACC_VER_MAJOR__ == 10 \ |
|
&& (__CUDACC_VER_MINOR__ < 1 || (__CUDACC_VER_MINOR__ == 1 && __CUDACC_VER_BUILD__ < 243))) |
|
#error STL1002: Unexpected compiler version, expected CUDA 10.1 Update 2 or newer. |
|
#endif // ^^^ old CUDA ^^^ |
Joachim Meyer (@fodinabor) reported:
This breaks CUDA with any Clang version that does not report CUDA > 10.1 (i.e. Clang from 11.0.0 to main can build with CUDA 10.1+ but always reports 10.1)
And as the Clang version 11.0.0+ seems to be supported otherwise (implements if constexpr), it'd be great if we could just add a check whether clang is used or nvcc (or nvc++..)
I was unaware that Clang could compile CUDA code. This is detectable through predefined macros:
https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code
We should consider:
- Refining this version check (adding
!defined(__clang__) to the last test might be correct)
- Adding test coverage for this scenario (which should be possible as we have both Clang and the CUDA SDK installed on the CI machines)
After we merged #1544 which added a version check:
STL/stl/inc/yvals_core.h
Lines 548 to 553 in 3cafa97
Joachim Meyer (@fodinabor) reported:
I was unaware that Clang could compile CUDA code. This is detectable through predefined macros:
https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code
We should consider:
!defined(__clang__)to the last test might be correct)