Skip to content

Commit 01ccf97

Browse files
authored
Only use functions in the limited API (#1545)
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
1 parent c74dda2 commit 01ccf97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/rmm/rmm/_lib/device_buffer.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import numpy as np
1515

1616
cimport cython
17-
from cpython.bytes cimport PyBytes_AS_STRING, PyBytes_FromStringAndSize
17+
from cpython.bytes cimport PyBytes_FromStringAndSize
1818
from libc.stdint cimport uintptr_t
1919
from libcpp.memory cimport unique_ptr
2020
from libcpp.utility cimport move
@@ -314,7 +314,7 @@ cdef class DeviceBuffer:
314314
cdef size_t s = dbp.size()
315315

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

0 commit comments

Comments
 (0)