Skip to content

Conversation

@sanchitintel
Copy link

@sanchitintel sanchitintel commented Oct 23, 2025

Summary

make_block_2d_copy_CD must not be called with a void CopyOp, so adding corresponding static_asserts to prevent relevant future bugs.
Doesn't solve any current issues, so maybe not high priority, but good to have.

…ant future bugs

`make_block_2d_copy_CD` must not be called with a `void` `CopyOp`
Comment on lines 995 to 997
YMode const& y_mode)
{
static_assert(is_xe_block_2d_atom_v<CopyOp>, "Expected a block 2D atom");

Choose a reason for hiding this comment

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

We don't need extra static assert here as you are already providing on line number 984 so if user send some old ops its will stop there itself, it will never go to 985 which will call
make_block_2d_copy_CD(CopyOp const& op, // Copy operation
TiledMMA const& mma, // TiledMMA instance
Stride<Strides...> const& gstride, // Global memory strides
XMode const& x_mode, // x, y modes
YMode const& y_mode)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing!

I created this PR based on the discussion in #576 (comment).

Nevertheless, in the future, if some code-changes would result in these make_block_2d_copy_CD overloads being called from elsewhere, then these asserts should be added.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry, I had misread your comment. I revised the PR.

@sanchitintel

This comment was marked as resolved.

@sanchitintel
Copy link
Author

Had closed by mistake.

TiledMMA const& mma, // TiledMMA instance
Stride<Strides...> const& gstride) // Global memory strides
{
static_assert(is_xe_block_2d_atom_v<CopyOp>, "Expected a block 2D atom");
Copy link

@rolandschulz rolandschulz Oct 23, 2025

Choose a reason for hiding this comment

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

This overload is also not really expected to be called directly but only by the other overload which already has the static_assert. And the equivalent overload for A/B also don't have the static_assert

Copy link
Author

Choose a reason for hiding this comment

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

For A & B, CopyOp can be void, so they don't need a corresponding assert

@rolandschulz
Copy link

I suggest to close this

@sanchitintel
Copy link
Author

Not needed.

@tdeng5 tdeng5 deleted the static_asserts_in_make_block_2d_copy_2d branch October 24, 2025 00:49
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.

4 participants