-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add boolean cases for CPU kernels (#3059)
* feat: add awkward_ListArray_getitem_jagged_apply.cu and awkward_ListArray_getitem_jagged_shrink * fix: use cupy.ones instead of multiple kernels * feat: add awkward_NumpyArray_rearrange_shifted CUDA kernel * feat: add new CPU kernel for awkward_unique_bool_64 * fix: test outputs * feat: add bool case for awkward_unique * fix: tolength assignment * fix: test cases * feat: add bool case for some kernels * fix: test case errors * fix: remove templates for bool * fix: segfault in ctypes double pointer * fix: assume sorted array for awkward_unique tests * fix: clean up PR * fix: remove awkward_NumpyArray_fill kernel * fix: remove awkward_unique and awkward_unique_copy kernels * fix: lint error * fix: unexpected keyword argument equal_nan error
- Loading branch information
1 parent
28d8917
commit 8a701a5
Showing
24 changed files
with
793 additions
and
2,197 deletions.
There are no files selected for viewing
826 changes: 0 additions & 826 deletions
826
awkward-cpp/src/cpu-kernels/awkward_NumpyArray_fill.cpp
This file was deleted.
Oops, something went wrong.
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
37 changes: 37 additions & 0 deletions
37
awkward-cpp/src/cpu-kernels/awkward_NumpyArray_subrange_equal_bool.cpp
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,37 @@ | ||
// BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE | ||
|
||
#define FILENAME(line) FILENAME_FOR_EXCEPTIONS_C("src/cpu-kernels/awkward_NumpyArray_subrange_equal_bool.cpp", line) | ||
|
||
#include "awkward/kernels.h" | ||
|
||
ERROR awkward_NumpyArray_subrange_equal_bool( | ||
bool* tmpptr, | ||
const int64_t* fromstarts, | ||
const int64_t* fromstops, | ||
int64_t length, | ||
bool* toequal) { | ||
|
||
bool differ = true; | ||
int64_t leftlen; | ||
int64_t rightlen; | ||
|
||
for (int64_t i = 0; i < length - 1; i++) { | ||
leftlen = fromstops[i] - fromstarts[i]; | ||
for (int64_t ii = i + 1; ii < length - 1; ii++) { | ||
rightlen = fromstops[ii] - fromstarts[ii]; | ||
if (leftlen == rightlen) { | ||
differ = false; | ||
for (int64_t j = 0; j < leftlen; j++) { | ||
if ((tmpptr[fromstarts[i] + j] != 0) != (tmpptr[fromstarts[ii] + j] != 0)) { | ||
differ = true; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
*toequal = !differ; | ||
|
||
return success(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.