Skip to content

Commit

Permalink
Use utility functions from dpctl.tensor._type_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Apr 4, 2024
1 parent e13d0e8 commit bcd473c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions dpnp/dpnp_iface_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@


import dpctl.tensor as dpt
import dpctl.tensor._accumulation as da
import dpctl.tensor._type_utils as dtu
import numpy
from numpy.core.numeric import (
Expand Down Expand Up @@ -936,7 +935,7 @@ def cumsum(a, axis=None, dtype=None, out=None):

# get dtype used by dpctl for result array in cumulative_sum
if dtype is None:
res_dt = da._default_accumulation_dtype(a.dtype, a.sycl_queue)
res_dt = dtu._default_accumulation_dtype(a.dtype, a.sycl_queue)
else:
res_dt = dpnp.dtype(dtype)
res_dt = dtu._to_device_supported_dtype(res_dt, a.sycl_device)
Expand Down Expand Up @@ -2974,8 +2973,6 @@ def sum(
)
)
):
from dpctl.tensor._reduction import _default_reduction_dtype

from dpnp.backend.extensions.sycl_ext import _sycl_ext_impl

input = a
Expand All @@ -2985,7 +2982,7 @@ def sum(

queue = input.sycl_queue
out_dtype = (
_default_reduction_dtype(input.dtype, queue)
dtu._default_reduction_dtype(input.dtype, queue)
if dtype is None
else dtype
)
Expand Down

0 comments on commit bcd473c

Please sign in to comment.