Skip to content

Commit

Permalink
Merge pull request #1 from dantegd/fea-ext-comms-pr1
Browse files Browse the repository at this point in the history
[WIP] Use relative imports
  • Loading branch information
cjnolet authored May 19, 2020
2 parents bc39321 + aae4625 commit e9c0995
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions python/raft/common/handle.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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 +
8 changes: 5 additions & 3 deletions python/raft/common/handle.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e9c0995

Please sign in to comment.