Skip to content

Commit

Permalink
Fix C++17 version detection in helper_macros.hpp (#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 #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
nickjeliopoulos and mhoemmen authored May 28, 2024
1 parent 033d9ef commit 637b159
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 @@ -146,7 +146,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 637b159

Please sign in to comment.