File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 PyCapsule_IsValid ,
1616 PyCapsule_SetName ,
1717)
18- from cython .cimports .cpython .ref import Py_DECREF , Py_INCREF , PyObject
18+ from cython .cimports .cpython .ref import Py_DECREF , Py_INCREF
1919from cython .cimports .dlpack import DLManagedTensor , kDLCPU , kDLCUDA , kDLUInt
2020from cython .cimports .libc .stdint import int64_t , uint8_t
2121
@@ -1412,8 +1412,6 @@ def from_dlpack(
14121412 if dev0 != dev1 :
14131413 raise ValueError ("plane tensors must be on the same CUDA device" )
14141414 if dev_type0 == kDLCUDA :
1415- if dev0 != dev1 :
1416- raise ValueError ("plane tensors must be on the same CUDA device" )
14171415 if device_id is None :
14181416 device_id = dev0
14191417 elif device_id != dev0 :
@@ -1509,8 +1507,6 @@ def from_dlpack(
15091507 frame .ptr .width = width
15101508 frame .ptr .height = height
15111509 if dev_type0 == kDLCUDA :
1512- if primary_ctx is None :
1513- primary_ctx = True
15141510 if not isinstance (primary_ctx , (bool , int )):
15151511 raise TypeError ("primary_ctx must be a bool" )
15161512 primary_ctx = bool (primary_ctx )
Original file line number Diff line number Diff line change 22
33import cython
44import cython .cimports .libav as lib
5- from cython .cimports .av .buffer import Buffer
65from cython .cimports .av .error import err_check
76from cython .cimports .av .video .format import get_pix_fmt , get_video_format
87from cython .cimports .av .video .frame import VideoFrame
1312 PyCapsule_IsValid ,
1413 PyCapsule_New ,
1514)
16- from cython .cimports .cpython .ref import PyObject
1715from cython .cimports .dlpack import DLManagedTensor , kDLCPU , kDLCUDA , kDLUInt
1816from cython .cimports .libc .stdint import int64_t
1917from cython .cimports .libc .stdlib import free , malloc
@@ -120,6 +118,11 @@ def __dlpack__(self, stream: int | Any | None = None):
120118 "DLPack export is only implemented for CUDA hw frames"
121119 )
122120
121+ if stream is not None :
122+ raise NotImplementedError (
123+ "DLPack export with stream is not implemented for CUDA hw frames"
124+ )
125+
123126 frames_ctx : cython .pointer [lib .AVHWFramesContext ] = cython .cast (
124127 cython .pointer [lib .AVHWFramesContext ], self .frame .ptr .hw_frames_ctx .data
125128 )
You can’t perform that action at this time.
0 commit comments