Skip to content

Conversation

wenxin0319
Copy link
Contributor

This commit makes its files safe for use with "-Wimplicit-fallthrough".

@ccecka
Copy link
Contributor

ccecka commented May 22, 2025

Good point, though we should prefer a solution that doesn't use exceptions or std::.

Copy link

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.

@r-barnes
Copy link

r-barnes commented Jul 2, 2025

@ccecka - What solution would suggest?

Elsewhere in the project I see std::cerr followed by abort():

std::cerr << "CUDA error: " << cudaGetErrorString(result) << std::endl;
abort();

and std::cerr followed by std::exit:

std::cerr << "FATAL: Read '" << read << "' but expected '" << expected << "'" << std::endl;
std::exit(1);

and a number of uses of throw (link):

throw std::runtime_error("cudaGetDevice() failed");

throw cuda_exception("Failed to allocate memory", cuda_error);

As contributors @wenxin0319 and I would like to match the existing project style, and it seems to us that throw std::runtime_error is pretty reasonable given its existing use within the project.

If that's not the case, what should we do instead?

@thakkarV
Copy link
Collaborator

keeping live. will get back to you

@ccecka
Copy link
Contributor

ccecka commented Jul 24, 2025

We would prefer static_assert and assert when possible, but since these are host-only I suppose it's fine.

Approving now.

@thakkarV
Copy link
Collaborator

@Junkai-Wu CC

@Junkai-Wu
Copy link
Collaborator

@hwu36 This PR is ready to merge.

@hwu36 hwu36 merged commit 6dd13d4 into NVIDIA:main Aug 1, 2025
@r-barnes
Copy link

I've tried to enable -Wimplicit-fallthrough in #2661, but I'm not sure what I'm doing.

Albresky pushed a commit to Albresky/cutlass that referenced this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants