Skip to content

Commit

Permalink
Support the new Buffer in cudf (#1033)
Browse files Browse the repository at this point in the history
Support the new `Buffer` in rapidsai/cudf#12009

Fixes  #1032

Authors:
  - Mads R. B. Kristensen (https://github.com/madsbk)

Approvers:
  - Peter Andreas Entschev (https://github.com/pentschev)

URL: #1033
  • Loading branch information
madsbk authored Nov 3, 2022
1 parent 3dbc4c9 commit 4de1d84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions dask_cuda/get_device_memory_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def get_device_memory_objects_default(obj):
return dispatch(obj._pxy_get().obj)
if hasattr(obj, "data"):
return dispatch(obj.data)
if hasattr(obj, "_owner") and obj._owner is not None:
return dispatch(obj._owner)
owner = getattr(obj, "owner", None) or getattr(obj, "_owner", None)
if owner:
return dispatch(owner)
if hasattr(obj, "__cuda_array_interface__"):
return [obj]
return []
Expand Down
2 changes: 1 addition & 1 deletion dask_cuda/tests/test_proxify_host_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def test_dataframes_share_dev_mem():
# Even though the two dataframe doesn't point to the same cudf.Buffer object
assert view1["a"].data is not view2["a"].data
# They still share the same underlying device memory
assert view1["a"].data._owner._owner is view2["a"].data._owner._owner
view1["a"].data.ptr == view2["a"].data.ptr

dhf = ProxifyHostFile(
local_directory=root_dir, device_memory_limit=160, memory_limit=1000
Expand Down

0 comments on commit 4de1d84

Please sign in to comment.