Skip to content

replace static_assert(false) with host-only THROW #968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2025
Merged

Conversation

aartbik
Copy link
Collaborator

@aartbik aartbik commented May 23, 2025

No description provided.

@aartbik aartbik requested review from cliffburdick and Copilot May 23, 2025 22:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Replaces compile-time static_assert(false) checks for unimplemented branches with a host-only runtime error (MATX_THROW) guarded by #ifndef __CUDACC__.

  • Removed static_assert for unimplemented cases and introduced MATX_THROW on host only
  • Wrapped throws in #ifndef __CUDACC__ to exclude them from device compilation

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
include/matx/core/tensor_impl.h Replaced static_assert with host-only MATX_THROW for unimplemented case
include/matx/core/sparse_tensor_format.h Replaced two static_assert instances with host-only MATX_THROW for unimplemented cases
Comments suppressed due to low confidence (1)

include/matx/core/tensor_impl.h:945

  • [nitpick] The error message "unimplemented case" is generic; consider including context such as function name or branch identifier to aid debugging.
MATX_THROW(matxNotSupported, "unimplemented case");
@cliffburdick
Copy link
Collaborator

/build

2 similar comments
@aartbik
Copy link
Collaborator Author

aartbik commented May 24, 2025

/build

@cliffburdick
Copy link
Collaborator

/build

@aartbik aartbik merged commit 0b2dfde into NVIDIA:main May 25, 2025
1 check passed
@aartbik aartbik deleted the bak branch May 25, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants