|
37 | 37 | # pragma system_header
|
38 | 38 | #endif // no system header
|
39 | 39 |
|
40 |
| -// Enable the functionality of this header if |
| 40 | +// Include the NVTX3 C++ API if: |
41 | 41 | // * The NVTX3 C API is available in CTK
|
42 | 42 | // * NVTX is not explicitly disabled
|
43 |
| -// * C++14 is availabl for cuda::std::optional |
44 |
| -#if __has_include(<nvtx3/nvToolsExt.h>) && !defined(NVTX_DISABLE) && _CCCL_STD_VER >= 2014 |
| 43 | +#if __has_include(<nvtx3/nvToolsExt.h> ) && !defined(NVTX_DISABLE) |
45 | 44 | // Include our NVTX3 C++ wrapper if not available from the CTK
|
46 | 45 | # if __has_include(<nvtx3/nvtx3.hpp>) // TODO(bgruber): replace by a check for the first CTK version shipping the header
|
47 | 46 | # include <nvtx3/nvtx3.hpp>
|
48 | 47 | # else // __has_include(<nvtx3/nvtx3.hpp>)
|
49 | 48 | # include "nvtx3.hpp"
|
50 | 49 | # endif // __has_include(<nvtx3/nvtx3.hpp>)
|
| 50 | +#endif // __has_include(<nvtx3/nvToolsExt.h>) && !defined(NVTX_DISABLE) && _CCCL_STD_VER > 2011 |
51 | 51 |
|
| 52 | +// Enable the functionality of this header if: |
| 53 | +// * The NVTX3 C++ API V1 is available |
| 54 | +// * C++14 is availabl for cuda::std::optional |
| 55 | +#if defined(NVTX3_CPP_DEFINITIONS_V1_0) && _CCCL_STD_VER >= 2014 |
52 | 56 | # include <cuda/std/optional>
|
53 | 57 |
|
54 | 58 | CUB_NAMESPACE_BEGIN
|
@@ -82,7 +86,14 @@ CUB_NAMESPACE_END
|
82 | 86 | (void) __cub_nvtx3_range;)
|
83 | 87 |
|
84 | 88 | # define CUB_DETAIL_NVTX_RANGE_SCOPE(name) CUB_DETAIL_NVTX_RANGE_SCOPE_IF(true, name)
|
85 |
| -#else // __has_include(<nvtx3/nvToolsExt.h>) && !defined(NVTX_DISABLE) && _CCCL_STD_VER > 2011 |
| 89 | +#else // defined(NVTX3_CPP_DEFINITIONS_V1_0) && _CCCL_STD_VER >= 2014 |
| 90 | +// Tell the user we don't support their NVTX3 version. |
| 91 | +# if defined(_CCCL_COMPILER_MSVC) |
| 92 | +# pragma message("warning: CUB only supports NVTX3 V1. Please open an issue on GitHub.") |
| 93 | +# else |
| 94 | +# warning CUB only supports NVTX3 V1. Please open an issue on GitHub. |
| 95 | +# endif |
| 96 | + |
86 | 97 | # define CUB_DETAIL_NVTX_RANGE_SCOPE_IF(condition, name)
|
87 | 98 | # define CUB_DETAIL_NVTX_RANGE_SCOPE(name)
|
88 |
| -#endif // __has_include(<nvtx3/nvToolsExt.h>) && !defined(NVTX_DISABLE) && _CCCL_STD_VER > 2011 |
| 99 | +#endif // defined(NVTX3_CPP_DEFINITIONS_V1_0) && _CCCL_STD_VER >= 2014 |
0 commit comments