Skip to content

Commit

Permalink
Merge branch 'nv-legate:branch-24.03' into enh-ext-rng
Browse files Browse the repository at this point in the history
  • Loading branch information
aschaffer authored Mar 12, 2024
2 parents 6039dfc + 9ece0a3 commit 51424ac
Show file tree
Hide file tree
Showing 16 changed files with 1,322 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmake/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"git_url" : "https://github.com/nv-legate/legate.core.git",
"git_shallow": false,
"always_download": false,
"git_tag" : "b84e86e9e3518d7102cdf531b5b733dc09c0e8d9"
"git_tag" : "0f509a007f36609d2b0bd536d8e5c54f2391b444"
}
}
}
2 changes: 2 additions & 0 deletions cunumeric/_ufunc/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@
"logical_and",
BinaryOpCode.LOGICAL_AND,
relation_types_of(all_dtypes),
red_code=UnaryRedCode.ALL,
)

logical_or = create_binary_ufunc(
"Compute the truth value of x1 OR x2 element-wise.",
"logical_or",
BinaryOpCode.LOGICAL_OR,
relation_types_of(all_dtypes),
red_code=UnaryRedCode.ANY,
)

logical_xor = create_binary_ufunc(
Expand Down
11 changes: 11 additions & 0 deletions cunumeric/_ufunc/ufunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,16 @@ def reduce(
f"reduction for {self} is not yet implemented"
)

if self._op_code in [
BinaryOpCode.LOGICAL_AND,
BinaryOpCode.LOGICAL_OR,
]:
res_dtype = bool
if dtype is not None:
raise TypeError("Cannot set dtype on a logical reduction")
else:
res_dtype = None

# NumPy seems to be using None as the default axis value for scalars
if array.ndim == 0 and axis == 0:
axis = None
Expand All @@ -767,6 +777,7 @@ def reduce(
keepdims=keepdims,
initial=initial,
where=where,
res_dtype=res_dtype,
)


Expand Down
14 changes: 14 additions & 0 deletions cunumeric/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,20 @@ def clip(
Multiple GPUs, Multiple CPUs
"""
min = (
min
if min is not None
else np.iinfo(self.dtype).min
if self.dtype.kind == "i"
else -np.inf
)
max = (
max
if max is not None
else np.iinfo(self.dtype).max
if self.dtype.kind == "i"
else np.inf
)
args = (
np.array(min, dtype=self.dtype),
np.array(max, dtype=self.dtype),
Expand Down
Loading

0 comments on commit 51424ac

Please sign in to comment.