Skip to content

Commit 0672293

Browse files
Add compile-time check for #1720 (#1722)
1 parent 8b52502 commit 0672293

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

include/openPMD/openPMD.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@
2525
namespace openPMD
2626
{}
2727

28+
#if defined(CUDA_VERSION) && !defined(OPENPMD_SKIP_CHECK_ISSUE_1720)
29+
static_assert(__cplusplus < 202002L || CUDA_VERSION >= 12040, R"(
30+
Cannot use the openPMD-api in C++20 projects under a Cuda version lower
31+
than 12.4.0 due to a bug in the implementation of std::variant.
32+
Further information at:
33+
https://github.com/openPMD/openPMD-api/issues/1720
34+
https://forums.developer.nvidia.com/t/nvcc-c-20-std-variant-complie-failed/270162/5
35+
This cannot be fixed on our side, please either upgrade to CUDA >= 12.4.0
36+
or use C++17.
37+
If you think that this assertion is shown wrongly, please apply
38+
'#define OPENPMD_SKIP_CHECK_ISSUE_1720' before including
39+
'<openPMD/openPMD.hpp>'.
40+
)");
41+
#endif
42+
2843
// IWYU pragma: begin_exports
2944
#include "openPMD/Dataset.hpp"
3045
#include "openPMD/Datatype.hpp"

0 commit comments

Comments
 (0)