test: add error-path coverage for cuda_utils and related regression check#1776
Open
rluo8 wants to merge 1 commit intoNVIDIA:mainfrom
Open
test: add error-path coverage for cuda_utils and related regression check#1776rluo8 wants to merge 1 commit intoNVIDIA:mainfrom
rluo8 wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
Contributor
Author
|
Hi @mdboom , could you please help review it ? |
|
Contributor
|
/ok to test |
mdboom
requested changes
Mar 17, 2026
Contributor
mdboom
left a comment
There was a problem hiding this comment.
One small suggested change. Other than that, LGTM, assuming the tests pass.
cuda_core/tests/test_cuda_utils.py
Outdated
| def test_check_nvrtc_error_with_handle(init_cuda): | ||
| from cuda.bindings import nvrtc | ||
|
|
||
| _, prog = nvrtc.nvrtcCreateProgram(b"invalid code!@#$", b"test.cu", 0, [], []) |
Contributor
There was a problem hiding this comment.
Suggested change
| _, prog = nvrtc.nvrtcCreateProgram(b"invalid code!@#$", b"test.cu", 0, [], []) | |
| err, prog = nvrtc.nvrtcCreateProgram(b"invalid code!@#$", b"test.cu", 0, [], []) | |
| assert err == nvrtc.nvrtcResult.NVRTC_SUCCESS |
Contributor
Author
There was a problem hiding this comment.
Updated the codes. The tests could pass in local run.
../../../../cuda_core/tests/test_cuda_utils.py::test_check_nvrtc_error_with_handle PASSED
......\cuda_core\tests\test_cuda_utils.py::test_check_nvrtc_error_with_handle PASSED
Contributor
|
/ok to test |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is to add error path coverage to increate the coverage for cuda_core.
The tests are mainly used to cover the error handling path.
The coverage data is running locally on Linux and Windows A10 system.
cuda/core/_utils/cuda_utils.pyx from 69.91% to 92.04%
cuda/core/clear_error_support.py from 75% to 100%
cuda/core/_kernel_arg_handler.pyx from 76.1% to 79.51%