diff --git a/python/cuspatial/cuspatial/tests/spatial/join/test_point_in_polygon.py b/python/cuspatial/cuspatial/tests/spatial/join/test_point_in_polygon.py index d4fb1d819..2bdda7b1d 100644 --- a/python/cuspatial/cuspatial/tests/spatial/join/test_point_in_polygon.py +++ b/python/cuspatial/cuspatial/tests/spatial/join/test_point_in_polygon.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. import numpy as np @@ -245,17 +245,17 @@ def test_pip_bitmap_column_to_binary_array(): expected = np.array( [[0, 0, 0, 0], [1, 1, 0, 1], [0, 0, 1, 1], [1, 0, 0, 1]], dtype="int8" ) - np.testing.assert_array_equal(got.copy_to_host(), expected) + np.testing.assert_array_equal(got.get(), expected) col = cudf.Series([], dtype="i8")._column got = pip_bitmap_column_to_binary_array(col, width=0) expected = np.array([], dtype="int8").reshape(0, 0) - np.testing.assert_array_equal(got.copy_to_host(), expected) + np.testing.assert_array_equal(got.get(), expected) col = cudf.Series([None, None], dtype="float64")._column got = pip_bitmap_column_to_binary_array(col, width=0) expected = np.array([], dtype="int8").reshape(2, 0) - np.testing.assert_array_equal(got.copy_to_host(), expected) + np.testing.assert_array_equal(got.get(), expected) col = cudf.Series( [ @@ -273,9 +273,9 @@ def test_pip_bitmap_column_to_binary_array(): ], dtype="int8", ) - np.testing.assert_array_equal(got.copy_to_host(), expected) + np.testing.assert_array_equal(got.get(), expected) col = cudf.Series([0, 0, 0])._column got = pip_bitmap_column_to_binary_array(col, width=3) expected = np.array([[0, 0, 0], [0, 0, 0], [0, 0, 0]], dtype="int8") - np.testing.assert_array_equal(got.copy_to_host(), expected) + np.testing.assert_array_equal(got.get(), expected) diff --git a/python/cuspatial/cuspatial/utils/join_utils.py b/python/cuspatial/cuspatial/utils/join_utils.py index 46bd476df..c966ec796 100644 --- a/python/cuspatial/cuspatial/utils/join_utils.py +++ b/python/cuspatial/cuspatial/utils/join_utils.py @@ -1,7 +1,8 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. import operator +import cupy as cp from numba import cuda import rmm @@ -27,7 +28,7 @@ def binarize(in_col, out, width): def apply_binarize(in_col, width): buf = rmm.DeviceBuffer(size=(in_col.size * width)) - out = cuda.as_cuda_array(buf).view("int8").reshape((in_col.size, width)) + out = cp.asarray(buf).view("int8").reshape((in_col.size, width)) if out.size > 0: out[:] = 0 binarize.forall(out.size)(in_col, out, width)