Skip to content

Commit

Permalink
Only use functions in the limited API (#1545)
Browse files Browse the repository at this point in the history
This PR removes usage of the only method in rmm's Cython that is not part of the Python limited API. Contributes to rapidsai/build-planning#42

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - https://github.com/jakirkham

Approvers:
  - https://github.com/jakirkham

URL: #1545
  • Loading branch information
vyasr authored Apr 30, 2024
1 parent c74dda2 commit 01ccf97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/rmm/rmm/_lib/device_buffer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import numpy as np

cimport cython
from cpython.bytes cimport PyBytes_AS_STRING, PyBytes_FromStringAndSize
from cpython.bytes cimport PyBytes_FromStringAndSize
from libc.stdint cimport uintptr_t
from libcpp.memory cimport unique_ptr
from libcpp.utility cimport move
Expand Down Expand Up @@ -314,7 +314,7 @@ cdef class DeviceBuffer:
cdef size_t s = dbp.size()

cdef bytes b = PyBytes_FromStringAndSize(NULL, s)
cdef unsigned char* p = <unsigned char*>PyBytes_AS_STRING(b)
cdef unsigned char* p = b
cdef unsigned char[::1] mv = (<unsigned char[:(s + 1):1]>p)[:s]
self.copy_to_host(mv, stream)

Expand Down

0 comments on commit 01ccf97

Please sign in to comment.