Skip to content

Commit

Permalink
Revert "Temporary hack to avoid kokkosgh-184"
Browse files Browse the repository at this point in the history
This reverts commit 9fa8784.
  • Loading branch information
tylerjereddy committed Mar 16, 2023
1 parent 9fa8784 commit 3cf39bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pykokkos/lib/ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def sqrt_impl_2d_float(tid: int, view: pk.View2D[pk.float], out: pk.View2D[pk.fl
out[tid][i] = sqrt(view[tid][i]) # type: ignore


def sqrt(view, out):
def sqrt(view):
"""
Return the non-negative square root of the argument, element-wise.
Expand All @@ -241,6 +241,7 @@ def sqrt(view, out):
# are available in pykokkos?
if len(view.shape) > 2:
raise NotImplementedError("only up to 2D views currently supported for sqrt() ufunc.")
out = pk.View(view.shape, view.dtype)
if "double" in str(view.dtype) or "float64" in str(view.dtype):
if view.shape == ():
pk.parallel_for(1, sqrt_impl_1d_double, view=view, out=out)
Expand All @@ -255,6 +256,7 @@ def sqrt(view, out):
pk.parallel_for(view.shape[0], sqrt_impl_1d_float, view=view, out=out)
elif len(view.shape) == 2:
pk.parallel_for(view.shape[0], sqrt_impl_2d_float, view=view, out=out)
return out


@pk.workunit
Expand Down

0 comments on commit 3cf39bb

Please sign in to comment.