cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

Enable implicit fallthrough

Open r-barnes opened this issue 3 months ago • 3 comments

-Wimplicit-fallthrough is a very high signal warning. In internal testing we found that 30-40% of flagged instances were bugs of some sort.

CUTLASS currently passes -Wimplicit-fallthrough, but doesn't enforce it.

In this diff I'm attempting to enable the flag, but I'm not sure how: I'm unable to find a place where CUTLASS enables warning flags, even basic things like -Wall.

I'm worried that maybe CUTLASS doesn't use warning flags at all?

r-barnes avatar Sep 22 '25 17:09 r-barnes

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 Oct 22 '25 18:10 github-actions[bot]

You are in the right spot with that error for clang, but since nvcc doesn't support that error directly, you need to change the code just slightly to only pass that flag to the host compiler.

if (CUTLASS_CLANG_HOST_COMPILE)

  ...

  # Enable implicit-fallthrough as error
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=implicit-fallthrough")
  list(APPEND CUTLASS_CUDA_NVCC_FLAGS -Xcompiler=-Werror=implicit-fallthrough)
  list(APPEND CUTLASS_CUDA_CLANG_FLAGS -Werror=implicit-fallthrough)

endif()

Community help in fixing and enabling more error and warning coverage is always appreciated!

d-k-b avatar Oct 31 '25 03:10 d-k-b

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 Nov 30 '25 04:11 github-actions[bot]