cuda.core: add tests for ObjectCode.from_library#2281
Conversation
|
/ok to test a0f1507 |
|
|
Thanks, Jinfeng! Technically we already tested But I wouldn't complain for completeness 🙂 Let me get back to review tomorrow... |
leofang
left a comment
There was a problem hiding this comment.
Let's try to reduce the boilerplate code. I understand that it's a lot cheaper to just generate code using agents. But there is really no good reason to add same code over and over. pytest parametrization can go a long way.
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def get_saxpy_library(): |
There was a problem hiding this comment.
Consolidate this fixture with get_saxpy_object above.
| assert mod_obj.code_type == "library" | ||
|
|
||
|
|
||
| def test_object_code_load_library_with_linker(get_saxpy_library, init_cuda): |
There was a problem hiding this comment.
Consolidate the test with test_object_code_load_object_with_linker above.
Thanks for the review! I didn't realize test_device_launch.py already covers from_library. That path uses a toolkit cudadevrt library (file path) plus runtime Program compile. This PR adds the nvcc path (saxpy.o / saxpy.a) and covers both bytes and file-path inputs. Agree on cutting boilerplate. I've carefully reviewed the AI-generated code line by line and updated the PR with pytest parametrization. Happy to iterate if anything else stands out. |
|
/ok to test 5156984 |
Description
closes #663.
Adds tests for
ObjectCode.from_libraryand extends the saxpy test-binary infrastructure from #2193.build_test_binaries.sh: packagesaxpy.ointosaxpy.afor Linux /saxpy.libfor Windows vianvcc -libbuild-wheel.yml): upload library artifacts alongside object fixturestest_module.py: newget_saxpy_libraryfixture and three tests mirroringfrom_objectcoverage (bytes, file path, linker integration)Checklist