Skip to content

Commit

Permalink
Fix C++17 version detection in helper_macros.hpp (NVIDIA#1479)
Browse files Browse the repository at this point in the history
* It seems that __cplusplus can be inconsistent with _MSVC_LANG when discerning C++17 version. See NVIDIA#1474. Added switch to check _MSVC_LANG in addition to __cplusplus

* Fixed typo.

* Oops, another typo.

* Changed incorrect logic, ifndef to ifdef

* Define CUTLAS_CPLUSPLUS for language version testing

Co-authored-by: Mark Hoemmen <[email protected]>

---------

Co-authored-by: Mark Hoemmen <[email protected]>
  • Loading branch information
2 people authored and aacostadiaz committed Jul 16, 2024
1 parent ae858b2 commit 039211b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/cutlass/detail/helper_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ namespace cutlass {

////////////////////////////////////////////////////////////////////////////////////////////////////

#if (201700L <= __cplusplus)
#if defined(_MSVC_LANG)
# define CUTLASS_CPLUSPLUS _MSVC_LANG
#else
# define CUTLASS_CPLUSPLUS __cplusplus
#endif

#if (201700L <= CUTLASS_CPLUSPLUS)
#define CUTLASS_CONSTEXPR_IF_CXX17 constexpr
#define CUTLASS_CXX17_OR_LATER 1
#else
Expand Down

0 comments on commit 039211b

Please sign in to comment.