From aae4625361664d0ae7ff2a554d72ffafa3825d70 Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Tue, 19 May 2020 10:23:24 -0500 Subject: [PATCH] FIX Use relative imports --- python/raft/common/handle.pxd | 6 +++--- python/raft/common/handle.pyx | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/python/raft/common/handle.pxd b/python/raft/common/handle.pxd index dfdcdb929b..3b60e6708e 100644 --- a/python/raft/common/handle.pxd +++ b/python/raft/common/handle.pxd @@ -21,7 +21,7 @@ from libcpp.memory cimport shared_ptr -cimport raft.common.cuda +from .cuda cimport _Stream cdef extern from "raft/mr/device/allocator.hpp" \ @@ -33,7 +33,7 @@ cdef extern from "raft/handle.hpp" namespace "raft" nogil: cdef cppclass handle_t: handle_t() except + handle_t(int ns) except + - void set_stream(raft.common.cuda._Stream s) except + + void set_stream(_Stream s) except + void set_device_allocator(shared_ptr[allocator] a) except + - raft.common.cuda._Stream get_stream() except + + _Stream get_stream() except + int get_num_internal_streams() except + diff --git a/python/raft/common/handle.pyx b/python/raft/common/handle.pyx index c19cbc8faa..6658a825ce 100644 --- a/python/raft/common/handle.pyx +++ b/python/raft/common/handle.pyx @@ -19,9 +19,11 @@ # cython: embedsignature = True # cython: language_level = 3 -import raft +# import raft from libcpp.memory cimport shared_ptr -from raft.common.cuda cimport _Stream, _Error, cudaStreamSynchronize + +from .cuda cimport _Stream, _Error, cudaStreamSynchronize +from .cuda import CudaRuntimeError cdef class Handle: """ @@ -81,7 +83,7 @@ cdef class Handle: cdef _Stream stream = h_.get_stream() cdef _Error e = cudaStreamSynchronize(stream) if e != 0: - raise raft.cuda.CudaRuntimeError("Stream sync") + raise CudaRuntimeError("Stream sync") def getHandle(self): return self.h