File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -754,6 +754,10 @@ inline CUlibrary as_cu(const LibraryHandle& h) noexcept {
754754 return h ? *h : nullptr ;
755755}
756756
757+ inline CUmodule as_cu (const CUmodule& h) noexcept {
758+ return h;
759+ }
760+
757761inline CUkernel as_cu (const KernelHandle& h) noexcept {
758762 return h ? *h : nullptr ;
759763}
@@ -838,10 +842,8 @@ inline std::intptr_t as_intptr(const LibraryHandle& h) noexcept {
838842 return reinterpret_cast <std::intptr_t >(as_cu (h));
839843}
840844
841- // Regular pointer (CUmodule), not a shared_ptr: lifetime is owned by the
842- // CUlibrary it was retrieved from.
843845inline std::intptr_t as_intptr (const CUmodule& h) noexcept {
844- return reinterpret_cast <std::intptr_t >(h );
846+ return reinterpret_cast <std::intptr_t >(as_cu (h) );
845847}
846848
847849inline std::intptr_t as_intptr (const KernelHandle& h) noexcept {
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core":
8585 cydriver.CUmemoryPool as_cu(MemoryPoolHandle h) noexcept nogil
8686 cydriver.CUdeviceptr as_cu(DevicePtrHandle h) noexcept nogil
8787 cydriver.CUlibrary as_cu(LibraryHandle h) noexcept nogil
88+ cydriver.CUmodule as_cu(cydriver.CUmodule h) noexcept nogil
8889 cydriver.CUkernel as_cu(KernelHandle h) noexcept nogil
8990 cydriver.CUgraph as_cu(GraphHandle h) noexcept nogil
9091 cydriver.CUgraphExec as_cu(GraphExecHandle h) noexcept nogil
You can’t perform that action at this time.
0 commit comments