Skip to content

test that elementwise ops on mismatched sizes throw DimensionMismatch - #731

Open
JohnCobbler wants to merge 1 commit into
JuliaGPU:mainfrom
JohnCobbler:test/dimension-mismatch-elementwise
Open

test that elementwise ops on mismatched sizes throw DimensionMismatch#731
JohnCobbler wants to merge 1 commit into
JuliaGPU:mainfrom
JohnCobbler:test/dimension-mismatch-elementwise

Conversation

@JohnCobbler

Copy link
Copy Markdown

Adding mismatched-size GPU arrays with + used to silently truncate to the
shorter operand (JuliaGPU/CUDA.jl#2812). That path is gone — + now goes
through Base promote_shape and throws DimensionMismatch symmetrically,
matching Base.Array. This adds a guard in the broadcasting testsuite so it
stays that way.

The check sits in the parameterized testsuite, so it runs for every backend;
on CPU CI it exercises the same dispatch (the throw happens in promote_shape
before any kernel launch), and a CUDA backend confirms the device path.

Co-authored-by: Claude <noreply@anthropic.com>
@christiangnrd
christiangnrd force-pushed the test/dimension-mismatch-elementwise branch from 69ed6ed to 9b3e6c9 Compare July 25, 2026 19:13
@christiangnrd christiangnrd changed the title test: elementwise ops on mismatched sizes throw DimensionMismatch test that elementwise ops on mismatched sizes throw DimensionMismatch Jul 26, 2026
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.

1 participant