Skip to content

Commit d77618a

Browse files
committed
Fix #789: Remove cycle between c.b.cyruntime and c.b._lib.cyruntime.cyruntime
1 parent ecb8113 commit d77618a

14 files changed

Lines changed: 479 additions & 557 deletions

File tree

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd
2929
cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx
3030
cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx
3131
cuda_bindings/cuda/bindings/_internal/nvvm.pyx
32-
cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd
33-
cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx
34-
cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd
35-
cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx
3632
cuda_bindings/cuda/bindings/_lib/utils.pxd
3733
cuda_bindings/cuda/bindings/_lib/utils.pyx
3834
cuda_bindings/cuda/bindings/cydriver.pxd

cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# This code was automatically generated with version 13.0.0. Do not modify it directly.
55
include "../cyruntime_types.pxi"
6+
include "../_lib/cyruntime/cyruntime.pxd"
67

78
{{if 'cudaDeviceReset' in found_functions}}
89

cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,3 +2671,5 @@ cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver no
26712671
return ptds._cudaProfilerStop()
26722672
return cudaProfilerStop()
26732673
{{endif}}
2674+
2675+
include "../_lib/cyruntime/cyruntime.pyx"

cuda_bindings/cuda/bindings/_lib/cyruntime/__init__.py

Whitespace-only changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
cimport cuda.bindings.cyruntime as cyruntime
5+
cimport cuda.bindings._bindings.cydriver as _cydriver
6+
7+
# These graphics API are the reimplemented version of what's supported by CUDA Runtime.
8+
# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us
9+
# use call into the static library directly.
10+
#
11+
# This is an ABI breaking change which can only happen in a major version bump.
12+
cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil
13+
cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil
14+
cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil
15+
cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil
16+
cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil
17+
cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
18+
cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
19+
cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil
20+
cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
21+
cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
22+
cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
23+
cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil
24+
cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
25+
cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil
26+
cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil
27+
cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil
28+
cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil
29+
cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil
30+
cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil
31+
32+
# utility functions
33+
34+
cdef cudaError_t getDriverEglFrame(_cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil
35+
cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, _cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil

cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)