diff --git a/python/rmm/rmm/_cuda/stream.py b/python/rmm/rmm/_cuda/stream.py index f36e5cc95..f508cec5b 100644 --- a/python/rmm/rmm/_cuda/stream.py +++ b/python/rmm/rmm/_cuda/stream.py @@ -14,15 +14,22 @@ import warnings -from rmm.pylibrmm.stream import ( # noqa: F401 +from rmm.pylibrmm.stream import ( DEFAULT_STREAM, LEGACY_DEFAULT_STREAM, PER_THREAD_DEFAULT_STREAM, Stream, ) +__all__ = [ + DEFAULT_STREAM, + LEGACY_DEFAULT_STREAM, + PER_THREAD_DEFAULT_STREAM, + Stream, +] + warnings.warn( - "The `rmm.pylibrmm.stream` module is deprecated in will be removed in a future release. Use `rmm.pylibrmm.stream` instead.", + "The `rmm._cuda.stream` module is deprecated in 25.02 and will be removed in a future release. Use `rmm.pylibrmm.stream` instead.", FutureWarning, stacklevel=2, ) diff --git a/python/rmm/rmm/pylibrmm/stream.pyx b/python/rmm/rmm/pylibrmm/stream.pyx index 07af37c5c..a02a80e23 100644 --- a/python/rmm/rmm/pylibrmm/stream.pyx +++ b/python/rmm/rmm/pylibrmm/stream.pyx @@ -66,50 +66,6 @@ cdef class Stream: """Return the underlying cudaStream_t pointer address as Python int.""" return int(self._cuda_stream) - # @singledispatchmethod - # def _init_from_stream(self, obj): - # if obj is None: - # self._init_with_new_cuda_stream() - # return - # try: - # protocol = getattr(obj, "__cuda_stream__") - # except AttributeError: - # raise ValueError( - # "Argument must be None, a Stream, or implement __cuda_stream__" - # ) - # if protocol[0] != 0: - # raise ValueError("Only protocol version 0 is supported") - - # self._cuda_stream = obj - # self.owner = obj - - # @_init_from_stream.register - # def _(self, stream: Stream): - # self._cuda_stream, self._owner = stream._cuda_stream, stream._owner - - # try: - # from numba import cuda - # @_init_from_stream.register - # def _(self, obj: cuda.cudadrv.driver.Stream): - # self._cuda_stream = (int(obj)) - # self._owner = obj - # except ImportError: - # pass - - # try: - # import cupy - # @_init_from_stream.register(cupy.cuda.stream.Stream) - # def _(self, obj): - # self._cuda_stream = (obj.ptr) - # self._owner = obj - - # @_init_from_stream.register(cupy.cuda.stream.ExternalStream) - # def _(self, obj): - # self._cuda_stream = (obj.ptr) - # self._owner = obj - # except ImportError: - # pass - @staticmethod cdef Stream _from_cudaStream_t(cudaStream_t s, object owner=None) except *: """