cuda/tests: fix array manipulation tests for cudasim and grid-stride correctness #706
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes multiple correctness and consistency issues in
numba/cuda/tests/test_array_manipulation.pyfor the CUDA backend.The changes focus on aligning test behavior with actual CUDA execution
semantics and ensuring tests are skipped appropriately when running
under the CUDA simulator (
cudasim).Changes
test_grid_stride_correctnessusing
cuda.grid(1)andcuda.gridsize(1)to match the test’s intent.@skip_on_cudasimto tests that rely on real device memorysemantics:
test_dtype_transitionstest_shape_semantics_in_kerneltest_memory_lifetimetest_grid_stride_correctnesstest_cpu_parity_referencetest_cpu_parity_referenceand reuse the module-leveladd_kernelfor consistency and maintainability.
cudasim.Rationale
Several tests relied on CUDA device semantics that are not supported
by the CUDA simulator, leading to misleading failures. Additionally,
the grid-stride test previously did not implement a true grid-stride
pattern, making the test name inaccurate.
These changes ensure:
If these changes are ready to be merged, I will continue by adding more
test files listed in the tracking issue and work toward completing the
entire test coverage list.
Fixes a part of #515