MCPcopy Create free account
hub / github.com/NVIDIA/DALI / cupy_adapter_sync

Function cupy_adapter_sync

dali/test/python/test_dltensor_operator.py:192–199  ·  view source on GitHub ↗
(fun, in1, in2)

Source from the content-addressed store, hash-verified

190
191
192def cupy_adapter_sync(fun, in1, in2):
193 with cupy_stream:
194 tin1 = [cupy.from_dlpack(dltensor) for dltensor in in1]
195 tin2 = [cupy.from_dlpack(dltensor) for dltensor in in2]
196 tout1, tout2 = fun(tin1, tin2)
197 out1, out2 = [tout.__dlpack__() for tout in tout1], [tout.__dlpack__() for tout in tout2]
198 cupy_stream.synchronize()
199 return out1, out2
200
201
202def cupy_adapter(fun, in1, in2):

Callers 1

cupy_wrapperFunction · 0.85

Calls 4

funFunction · 0.85
from_dlpackMethod · 0.80
__dlpack__Method · 0.45
synchronizeMethod · 0.45

Tested by

no test coverage detected