Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski authored May 3, 2024
2 parents 79b48bc + 082e1b7 commit 6bfe678
Show file tree
Hide file tree
Showing 49 changed files with 2,365 additions and 398 deletions.
Binary file modified .DS_Store
Binary file not shown.
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,21 @@ jobs:
- name: Test CPU kernels with explicitly defined values
run: python -m pytest -vv -rs awkward-cpp/tests-cpu-kernels-explicit

- name: Test non-kernels
- name: Test non-kernels (Python)
run: >-
python -m pytest -vv -rs tests --cov=awkward --cov-report=term
--cov-report=xml
if: startsWith(matrix.python-version, '3.')

- name: Test non-kernels (PyPy)
run: >-
python -m pytest -vv -rs tests
if: startsWith(matrix.python-version, 'pypy')

- name: Upload Codecov results
if: (matrix.python-version == '3.9') && (matrix.runs-on == 'ubuntu-latest')
uses: codecov/codecov-action@v4


Linux-ROOT:
runs-on: ubuntu-20.04

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ERROR awkward_ListArray_getitem_next_array_advanced(
const T* fromarray,
const T* fromadvanced,
int64_t lenstarts,
int64_t /* lenarray */, // FIXME: this argument is not needed
int64_t lencontent) {
for (int64_t i = 0; i < lenstarts; i++) {
if (fromstops[i] < fromstarts[i]) {
Expand Down Expand Up @@ -44,7 +43,6 @@ ERROR awkward_ListArray32_getitem_next_array_advanced_64(
const int64_t* fromarray,
const int64_t* fromadvanced,
int64_t lenstarts,
int64_t lenarray,
int64_t lencontent) {
return awkward_ListArray_getitem_next_array_advanced<int32_t, int64_t>(
tocarry,
Expand All @@ -54,7 +52,6 @@ ERROR awkward_ListArray32_getitem_next_array_advanced_64(
fromarray,
fromadvanced,
lenstarts,
lenarray,
lencontent);
}
ERROR awkward_ListArrayU32_getitem_next_array_advanced_64(
Expand All @@ -65,7 +62,6 @@ ERROR awkward_ListArrayU32_getitem_next_array_advanced_64(
const int64_t* fromarray,
const int64_t* fromadvanced,
int64_t lenstarts,
int64_t lenarray,
int64_t lencontent) {
return awkward_ListArray_getitem_next_array_advanced<uint32_t, int64_t>(
tocarry,
Expand All @@ -75,7 +71,6 @@ ERROR awkward_ListArrayU32_getitem_next_array_advanced_64(
fromarray,
fromadvanced,
lenstarts,
lenarray,
lencontent);
}
ERROR awkward_ListArray64_getitem_next_array_advanced_64(
Expand All @@ -86,7 +81,6 @@ ERROR awkward_ListArray64_getitem_next_array_advanced_64(
const int64_t* fromarray,
const int64_t* fromadvanced,
int64_t lenstarts,
int64_t lenarray,
int64_t lencontent) {
return awkward_ListArray_getitem_next_array_advanced<int64_t, int64_t>(
tocarry,
Expand All @@ -96,6 +90,5 @@ ERROR awkward_ListArray64_getitem_next_array_advanced_64(
fromarray,
fromadvanced,
lenstarts,
lenarray,
lencontent);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ ERROR awkward_ListOffsetArray_flatten_offsets(
T* tooffsets,
const C* outeroffsets,
int64_t outeroffsetslen,
const T* inneroffsets,
int64_t /* inneroffsetslen */) { // FIXME: this argument is not needed
const T* inneroffsets) {
for (int64_t i = 0; i < outeroffsetslen; i++) {
tooffsets[i] =
inneroffsets[outeroffsets[i]];
Expand All @@ -21,38 +20,32 @@ ERROR awkward_ListOffsetArray32_flatten_offsets_64(
int64_t* tooffsets,
const int32_t* outeroffsets,
int64_t outeroffsetslen,
const int64_t* inneroffsets,
int64_t inneroffsetslen) {
const int64_t* inneroffsets) {
return awkward_ListOffsetArray_flatten_offsets<int64_t, int32_t>(
tooffsets,
outeroffsets,
outeroffsetslen,
inneroffsets,
inneroffsetslen);
inneroffsets);
}
ERROR awkward_ListOffsetArrayU32_flatten_offsets_64(
int64_t* tooffsets,
const uint32_t* outeroffsets,
int64_t outeroffsetslen,
const int64_t* inneroffsets,
int64_t inneroffsetslen) {
const int64_t* inneroffsets) {
return awkward_ListOffsetArray_flatten_offsets<int64_t, uint32_t>(
tooffsets,
outeroffsets,
outeroffsetslen,
inneroffsets,
inneroffsetslen);
inneroffsets);
}
ERROR awkward_ListOffsetArray64_flatten_offsets_64(
int64_t* tooffsets,
const int64_t* outeroffsets,
int64_t outeroffsetslen,
const int64_t* inneroffsets,
int64_t inneroffsetslen) {
const int64_t* inneroffsets) {
return awkward_ListOffsetArray_flatten_offsets<int64_t, int64_t>(
tooffsets,
outeroffsets,
outeroffsetslen,
inneroffsets,
inneroffsetslen);
inneroffsets);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ awkward_NumpyArray_rearrange_shifted(
const FROM* fromoffsets,
int64_t offsetslength,
const FROM* fromparents,
int64_t /* parentslength */, // FIXME: these arguments are not needed
const FROM* fromstarts,
int64_t /* startslength */) {
const FROM* fromstarts) {
int64_t k = 0;
for (int64_t i = 0; i < offsetslength - 1; i++) {
for (int64_t j = 0; j < fromoffsets[i + 1] - fromoffsets[i]; j++) {
Expand All @@ -39,9 +37,7 @@ awkward_NumpyArray_rearrange_shifted_toint64_fromint64(
const int64_t* fromoffsets,
int64_t offsetslength,
const int64_t* fromparents,
int64_t parentslength,
const int64_t* fromstarts,
int64_t startslength) {
const int64_t* fromstarts) {
return awkward_NumpyArray_rearrange_shifted<int64_t, int64_t>(
toptr, fromshifts, length, fromoffsets, offsetslength, fromparents, parentslength, fromstarts, startslength);
toptr, fromshifts, length, fromoffsets, offsetslength, fromparents, fromstarts);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ERROR awkward_RegularArray_getitem_next_array_advanced(
const T* fromadvanced,
const T* fromarray,
int64_t length,
int64_t /* lenarray */, // FIXME: this argument is not needed
int64_t size) {
for (int64_t i = 0; i < length; i++) {
tocarry[i] = i*size + fromarray[fromadvanced[i]];
Expand All @@ -25,14 +24,12 @@ ERROR awkward_RegularArray_getitem_next_array_advanced_64(
const int64_t* fromadvanced,
const int64_t* fromarray,
int64_t length,
int64_t lenarray,
int64_t size) {
return awkward_RegularArray_getitem_next_array_advanced<int64_t>(
tocarry,
toadvanced,
fromadvanced,
fromarray,
length,
lenarray,
size);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ ERROR awkward_UnionArray_flatten_length(
T** offsetsraws) {
*total_length = 0;
for (int64_t i = 0; i < length; i++) {
FROMTAGS tag = fromtags[i];
FROMINDEX idx = fromindex[i];
int64_t tag = (int64_t)fromtags[i];
int64_t idx = (int64_t)fromindex[i];
T start = offsetsraws[tag][idx];
T stop = offsetsraws[tag][idx + 1];
*total_length = *total_length + (stop - start);
*total_length = *total_length + (int64_t)(stop - start);
}
return success();
}
Expand Down
21 changes: 0 additions & 21 deletions awkward-cpp/src/cpu-kernels/awkward_unique_ranges.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
template <typename T>
ERROR awkward_unique_ranges(
T* toptr,
int64_t /* length */, // FIXME: this argument is not needed
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
Expand All @@ -28,139 +27,119 @@ ERROR awkward_unique_ranges(

ERROR awkward_unique_ranges_int8(
int8_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<int8_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_uint8(
uint8_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<uint8_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_int16(
int16_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<int16_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_uint16(
uint16_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<uint16_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_int32(
int32_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<int32_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_uint32(
uint32_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<uint32_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_int64(
int64_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<int64_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_uint64(
uint64_t* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<uint64_t>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_float32(
float* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<float>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
}

ERROR awkward_unique_ranges_float64(
double* toptr,
int64_t length,
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
return awkward_unique_ranges<double>(
toptr,
length,
fromoffsets,
offsetslength,
tooffsets);
Expand Down
1 change: 0 additions & 1 deletion awkward-cpp/src/cpu-kernels/awkward_unique_ranges_bool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

ERROR awkward_unique_ranges_bool(
bool* toptr,
int64_t /* length */, // FIXME: this argument is not needed
const int64_t* fromoffsets,
int64_t offsetslength,
int64_t* tooffsets) {
Expand Down
2 changes: 1 addition & 1 deletion awkward-cpp/src/cpu-kernels/kernel-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void awkward_ListArray_combinations_step(
}
if (j + 1 == n) {
for (int64_t k = 0; k < n; k++) {
tocarry[k][toindex[k]] = fromindex[k];
tocarry[k][toindex[k]] = (T)fromindex[k];
toindex[k]++;
}
}
Expand Down
7 changes: 5 additions & 2 deletions dev/generate-kernel-signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"awkward_RegularArray_getitem_next_range_spreadadvanced",
"awkward_RegularArray_getitem_next_array",
"awkward_RegularArray_getitem_next_array_regularize",
"awkward_RegularArray_reduce_local_nextparents",
"awkward_RegularArray_reduce_nonlocal_preparenext",
"awkward_RegularArray_reduce_local_nextparents_64",
"awkward_RegularArray_reduce_nonlocal_preparenext_64",
"awkward_missing_repeat",
"awkward_RegularArray_getitem_jagged_expand",
"awkward_ListArray_combinations_length",
Expand Down Expand Up @@ -101,6 +101,9 @@
"awkward_ListOffsetArray_drop_none_indexes",
"awkward_ListOffsetArray_reduce_local_nextparents_64",
"awkward_ListOffsetArray_reduce_nonlocal_maxcount_offsetscopy_64",
"awkward_UnionArray_flatten_length",
"awkward_UnionArray_flatten_combine",
"awkward_UnionArray_nestedfill_tags_index",
"awkward_UnionArray_regular_index_getsize",
"awkward_UnionArray_simplify",
"awkward_UnionArray_simplify_one",
Expand Down
Loading

0 comments on commit 6bfe678

Please sign in to comment.