Skip to content

Commit

Permalink
Remove references to deprecated RMM functionality from Cython.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhemstad committed Jun 11, 2020
1 parent a4579d7 commit 13df503
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
17 changes: 0 additions & 17 deletions python/rmm/_lib/lib.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,3 @@ cdef extern from * nogil:
cudaError_t cudaMemcpyAsync(void* dst, const void* src, size_t count,
cudaMemcpyKind kind, cudaStream_t stream)
cudaError_t cudaStreamSynchronize(cudaStream_t stream)


cdef extern from "rmm/rmm.h" nogil:

ctypedef enum rmmError_t:
RMM_SUCCESS = 0,
RMM_ERROR_CUDA_ERROR,
RMM_ERROR_INVALID_ARGUMENT,
RMM_ERROR_NOT_INITIALIZED,
RMM_ERROR_OUT_OF_MEMORY,
RMM_ERROR_UNKNOWN,
RMM_ERROR_IO,
N_RMM_ERROR,

cdef const char * rmmGetErrorString(
rmmError_t errcode
) except +
21 changes: 0 additions & 21 deletions python/rmm/_lib/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,3 @@
# cython: embedsignature = True
# cython: language_level = 3


# Utility Functions
def _get_error_msg(errcode):
"""
Get error message for the given error code.
"""
msg = rmmGetErrorString(<rmmError_t>errcode)
cdef bytes py_msg = msg
return py_msg.decode("utf-8")


def check_error(errcode):
"""
Checks the error of a function that returns rmmError_t and raises a Python
exception based on the error code
"""
from rmm import RMMError

if errcode != RMM_SUCCESS:
msg = _get_error_msg(errcode)
raise RMMError(errcode, msg)

0 comments on commit 13df503

Please sign in to comment.