You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Turn all cdef class objects in the Python layer to cdef public class #464
@vzhurba01 I hope this is a simple one-liner change to the codegen and the remaining task is on verifying the generated headers. Could you take a look?
We need to expose the C definitions for all Python classes (via cdef public) and then use it with get_native_cuda_handle to unbox. @oleksandr-pavlyk pointed out that test code we had with get_native_cuda_handle got around with the first requirement because we tested it in Cython and we got the definition for free.
I think it should be cdef api instead of cdef public.
Yes if we need more than the type information from cuda.bindings.
Assigning to Sasha for now as he'd have a use case study. @oleksandr-pavlyk all the needed changes to cuda.bindings will need to be done in the cython-gen, so just report back what's needed to happen and we can find someone else to work on the next step.
Activity
leofang commentedon Feb 24, 2025
@vzhurba01 I hope this is a simple one-liner change to the codegen and the remaining task is on verifying the generated headers. Could you take a look?
leofang commentedon Apr 23, 2025
It is unclear to me if we still need this done if we want to go by the route of #564. @oleksandr-pavlyk @shwina WDYT?
shwina commentedon Apr 23, 2025
Hmm, if my understanding is correct, the two seem a bit orthogonal:
cdef publicwould allow e.g., third-party C/C++ code to use types defined in Cython (not sure if we know of use cases for this)get_native_hande()would allow us to grab a pointer to the underlying native CUDA object wrapped by a Cython typeAm I missing something or can (1) be used in place of (2) somehow?
oleksandr-pavlyk commentedon Apr 23, 2025
@leofang, I think it should be
cdef apiinstead ofcdef public.leofang commentedon May 23, 2025
Sorry I somehow dropped the ball and Sasha reminded me about this with a use case in mind (accessing
cuda.bindingstypes in pybind11).@shwina You're absolutely right. And it turns out we need both:
We need to expose the C definitions for all Python classes (via
cdef public) and then use it withget_native_cuda_handleto unbox. @oleksandr-pavlyk pointed out that test code we had withget_native_cuda_handlegot around with the first requirement because we tested it in Cython and we got the definition for free.Yes if we need more than the type information from
cuda.bindings.Assigning to Sasha for now as he'd have a use case study. @oleksandr-pavlyk all the needed changes to
cuda.bindingswill need to be done in the cython-gen, so just report back what's needed to happen and we can find someone else to work on the next step.