Use __pyx_capi__ for CUDA driver function pointers #1466
+203
−367
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
Replace the
_CUDA_DRIVER_API_V1capsule with direct extraction of function pointers fromcuda.bindings.cydriver.__pyx_capi__at module import time.Changes
CudaDriverApiV1struct and_get_cuda_driver_api_v1_capsule()from_resource_handles.pyxload_driver_api(),ensure_driver_loaded(), and related machinery fromresource_handles.cppresource_handles.hppPyCapsule_GetPointer()withPyCapsule_GetName()for signature lookup__pyx_capi__approachThis simplifies the architecture by eliminating the custom capsule struct and its loading machinery. The driver function pointers are now populated directly from Cython's built-in cross-module API mechanism.
Stats: 4 files changed, 228 insertions(+), 392 deletions(-) (net -164 lines)
Test Plan
test_stream.py,test_event.py,test_memory.py,test_device.pypassCloses #1450