Skip to content

Commit

Permalink
Replace as_device_scalar with cudf.Scalar.device_value
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Berg <[email protected]>
  • Loading branch information
mroeschke authored and seberg committed Dec 30, 2024
1 parent d43d878 commit e595469
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/legate_dataframe/lib/core/scalar.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import numbers
import cudf
import legate.core
import numpy
from cudf._lib.scalar import as_device_scalar

ScalarLike = numpy.number | numbers.Number | cudf.Scalar | legate.core.Scalar

Expand All @@ -39,5 +38,5 @@ cdef cpp_ScalarArg cpp_scalar_arg_from_python(scalar: ScalarLike):

# NOTE: Converting to a cudf scalar isn't really ideal, as we copy
# to the device, just to copy it back again to get a legate one.
cdef DeviceScalar cudf_scalar = <DeviceScalar>as_device_scalar(scalar)
cdef DeviceScalar cudf_scalar = <DeviceScalar>(cudf.Scalar(scalar).device_value)
return cpp_ScalarArg(dereference(cudf_scalar.get_raw_ptr()))

0 comments on commit e595469

Please sign in to comment.