diff --git a/python/cudf/cudf/_lib/spillable_buffer.pyx b/python/cudf/cudf/_lib/spillable_buffer.pyx index 2e7c3160650..a4d298b50c3 100644 --- a/python/cudf/cudf/_lib/spillable_buffer.pyx +++ b/python/cudf/cudf/_lib/spillable_buffer.pyx @@ -235,6 +235,9 @@ cdef class SpillableBuffer: return self._ptr cdef void* ptr_raw(self, SpillLock spill_lock) except *: + if spill_lock is None: + return self.ptr + # Get base buffer cdef SpillableBuffer base cdef size_t offset @@ -245,9 +248,6 @@ cdef class SpillableBuffer: base = self._view_desc["base"] offset = self._view_desc["offset"] - if spill_lock is None: - return base.ptr - with base._lock: base.move_inplace(target="gpu") base._last_accessed = time.monotonic()