-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'branch-22.03' into main
- Loading branch information
Showing
149 changed files
with
13,302 additions
and
5,392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2022 NVIDIA Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
from .bit_twiddling import * | ||
from .comparison import * | ||
from .math import * | ||
from .floating import * | ||
from .trigonometric import * | ||
from .ufunc import ufunc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright 2022 NVIDIA Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
from cunumeric.config import BinaryOpCode, UnaryOpCode | ||
|
||
from .ufunc import create_binary_ufunc, create_unary_ufunc, integer_dtypes | ||
|
||
bitwise_and = create_binary_ufunc( | ||
"Compute the bit-wise AND of two arrays element-wise.", | ||
"bitwise_and", | ||
BinaryOpCode.BITWISE_AND, | ||
["?"] + integer_dtypes, | ||
) | ||
|
||
bitwise_or = create_binary_ufunc( | ||
"Compute the bit-wise OR of two arrays element-wise.", | ||
"bitwise_or", | ||
BinaryOpCode.BITWISE_OR, | ||
["?"] + integer_dtypes, | ||
) | ||
|
||
bitwise_xor = create_binary_ufunc( | ||
"Compute the bit-wise XOR of two arrays element-wise.", | ||
"bitwise_xor", | ||
BinaryOpCode.BITWISE_XOR, | ||
["?"] + integer_dtypes, | ||
) | ||
|
||
invert = create_unary_ufunc( | ||
"Compute bit-wise inversion, or bit-wise NOT, element-wise.", | ||
"invert", | ||
UnaryOpCode.INVERT, | ||
["?"] + integer_dtypes, | ||
overrides={"?": UnaryOpCode.LOGICAL_NOT}, | ||
) | ||
|
||
left_shift = create_binary_ufunc( | ||
"Shift the bits of an integer to the left.", | ||
"left_shift", | ||
BinaryOpCode.LEFT_SHIFT, | ||
integer_dtypes, | ||
) | ||
|
||
right_shift = create_binary_ufunc( | ||
"Shift the bits of an integer to the right.", | ||
"right_shift", | ||
BinaryOpCode.RIGHT_SHIFT, | ||
integer_dtypes, | ||
) | ||
|
||
|
||
bitwise_not = invert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# Copyright 2022 NVIDIA Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
from cunumeric.config import BinaryOpCode, UnaryOpCode, UnaryRedCode | ||
|
||
from .ufunc import ( | ||
all_dtypes, | ||
create_binary_ufunc, | ||
create_unary_ufunc, | ||
float_dtypes, | ||
integer_dtypes, | ||
predicate_types_of, | ||
relation_types_of, | ||
) | ||
|
||
greater = create_binary_ufunc( | ||
"Return the truth value of (x1 > x2) element-wise.", | ||
"greater", | ||
BinaryOpCode.GREATER, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
greater_equal = create_binary_ufunc( | ||
"Return the truth value of (x1 >= x2) element-wise.", | ||
"greater_equal", | ||
BinaryOpCode.GREATER_EQUAL, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
less = create_binary_ufunc( | ||
"Return the truth value of (x1 < x2) element-wise.", | ||
"less", | ||
BinaryOpCode.LESS, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
less_equal = create_binary_ufunc( | ||
"Return the truth value of (x1 =< x2) element-wise.", | ||
"less", | ||
BinaryOpCode.LESS_EQUAL, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
not_equal = create_binary_ufunc( | ||
"Return (x1 != x2) element-wise.", | ||
"not_equal", | ||
BinaryOpCode.NOT_EQUAL, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
equal = create_binary_ufunc( | ||
"Return (x1 == x2) element-wise.", | ||
"equal", | ||
BinaryOpCode.EQUAL, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
logical_and = create_binary_ufunc( | ||
"Compute the truth value of x1 AND x2 element-wise.", | ||
"logical_and", | ||
BinaryOpCode.LOGICAL_AND, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
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), | ||
) | ||
|
||
logical_xor = create_binary_ufunc( | ||
"Compute the truth value of x1 XOR x2, element-wise.", | ||
"logical_xor", | ||
BinaryOpCode.LOGICAL_XOR, | ||
relation_types_of(all_dtypes), | ||
) | ||
|
||
logical_not = create_unary_ufunc( | ||
"Compute bit-wise inversion, or bit-wise NOT, element-wise.", | ||
"invert", | ||
UnaryOpCode.LOGICAL_NOT, | ||
( | ||
["??"] | ||
+ predicate_types_of(integer_dtypes) | ||
+ predicate_types_of(float_dtypes) | ||
), | ||
overrides={"?": UnaryOpCode.LOGICAL_NOT}, | ||
) | ||
|
||
maximum = create_binary_ufunc( | ||
"Element-wise maximum of array elements.", | ||
"maximum", | ||
BinaryOpCode.MAXIMUM, | ||
all_dtypes, | ||
red_code=UnaryRedCode.MAX, | ||
) | ||
|
||
fmax = maximum | ||
|
||
minimum = create_binary_ufunc( | ||
"Element-wise minimum of array elements.", | ||
"minimum", | ||
BinaryOpCode.MINIMUM, | ||
all_dtypes, | ||
red_code=UnaryRedCode.MIN, | ||
) | ||
|
||
fmin = minimum |
Oops, something went wrong.