current_cupy_stream

cubie.memory.mem_manager.current_cupy_stream(nb_stream: FakeStream) None[source]

Context manager that forwards a Numba stream into CuPy APIs.

CuPy is CuBIE’s single GPU allocation provider on a real device. Wrapping allocations and host/device copies in this context keeps them ordered on the same stream as the Numba-launched integration kernel.

Parameters:

nb_stream – Numba CUDA stream to expose to CuPy.

cubie.memory.mem_manager.nb_stream

The Numba stream being forwarded.

cubie.memory.mem_manager.cupy_ext_stream

CuPy external stream wrapper around the Numba stream.

Notes

Numba’s default stream (handle 0) is left as CuPy’s ambient current stream rather than wrapped, matching Numba’s own default stream semantics.