cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

Fix C++17 version detection in helper_macros.hpp

Open nickjeliopoulos opened this issue 1 year ago • 6 comments

It seems that __cplusplus can be inconsistent with _MSVC_LANG when discerning C++17 version in some cases (for header-only includes of CUTLASS). See https://github.com/NVIDIA/cutlass/issues/1474. Added switch to check _MSVC_LANG in addition to __cplusplus.

nickjeliopoulos avatar Apr 12 '24 18:04 nickjeliopoulos

@mhoemmen, can you take a look?

jackkosaian avatar Apr 12 '24 18:04 jackkosaian

Please set the flag /Zc:__cplusplus as shown in https://github.com/NVIDIA/cutlass/blob/7d49e6c7e2f8896c47f586706e67e1fb215529dc/CMakeLists.txt#L439-453 to get MSVC to set the compile options appropriately.

d-k-b avatar Apr 12 '24 18:04 d-k-b

I was able to include CUTLASS headers successfully with @d-k-b suggestion. I closed my issue #1474 related to this.

Is there still some value to this PR for those who want to include CUTLASS headers-only? Maybe this is better solved upstream (in something like PyTorch's torch/utils/cpp_extensions.py per my solution in #1474, or just leaving it to the user to configure builds more carefully?)

nickjeliopoulos avatar Apr 13 '24 02:04 nickjeliopoulos

@jackkosaian Hi! Thanks for the heads-up! I can take a look.

mhoemmen avatar Apr 15 '24 16:04 mhoemmen

Thanks for your review @mhoemmen. I committed your suggestion for the CUTLASS_CPLUSPLUS macro, I think that seems more elegant and is in line with the style of other CUTLASS macros.

nickjeliopoulos avatar Apr 15 '24 19:04 nickjeliopoulos

@nickjeliopoulos Excellent, thanks so much!

mhoemmen avatar Apr 16 '24 14:04 mhoemmen

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar May 25 '24 22:05 github-actions[bot]

Let me check on the status of this with @hwu36 .

mhoemmen avatar May 28 '24 14:05 mhoemmen

@hwu36 I think we can merge this.

mhoemmen avatar May 28 '24 14:05 mhoemmen