From f03a113b40dcb0b6c5d41a19a471464ea882e267 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 21 Nov 2024 17:58:52 +0100 Subject: [PATCH 1/4] fix limit on number of regular arrays --- .../awkward_UnionArray_regular_index.cpp | 39 +++++++++++++++++++ ...kward_UnionArray_regular_index_getsize.cpp | 9 +++++ kernel-specification.yml | 26 +++++++++++++ tests/test_3312_concatenate_regular_arrays.py | 10 +++++ 4 files changed, 84 insertions(+) create mode 100644 tests/test_3312_concatenate_regular_arrays.py diff --git a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp index bd7deb8c56..3f2db44ab8 100644 --- a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp +++ b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp @@ -60,3 +60,42 @@ ERROR awkward_UnionArray8_64_regular_index( fromtags, length); } +ERROR awkward_UnionArray64_32_regular_index( + int32_t* toindex, + int32_t* current, + int64_t size, + const int64_t* fromtags, + int64_t length) { + return awkward_UnionArray_regular_index( + toindex, + current, + size, + fromtags, + length); +} +ERROR awkward_UnionArray64_U32_regular_index( + uint32_t* toindex, + uint32_t* current, + int64_t size, + const int64_t* fromtags, + int64_t length) { + return awkward_UnionArray_regular_index( + toindex, + current, + size, + fromtags, + length); +} +ERROR awkward_UnionArray64_64_regular_index( + int64_t* toindex, + int64_t* current, + int64_t size, + const int64_t* fromtags, + int64_t length) { + return awkward_UnionArray_regular_index( + toindex, + current, + size, + fromtags, + length); +} diff --git a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp index f660fd8343..355c88a09b 100644 --- a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp +++ b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp @@ -28,3 +28,12 @@ ERROR awkward_UnionArray8_regular_index_getsize( fromtags, length); } +ERROR awkward_UnionArray64_regular_index_getsize( + int64_t* size, + const int64_t* fromtags, + int64_t length) { + return awkward_UnionArray_regular_index_getsize( + size, + fromtags, + length); +} diff --git a/kernel-specification.yml b/kernel-specification.yml index 5c901f00e2..5c6f9222ac 100644 --- a/kernel-specification.yml +++ b/kernel-specification.yml @@ -3479,6 +3479,27 @@ kernels: - {name: size, type: "int64_t", dir: in, role: default} - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} + - name: awkward_UnionArray64_32_regular_index + args: + - {name: toindex, type: "List[int32_t]", dir: out} + - {name: current, type: "List[int32_t]", dir: out} + - {name: size, type: "int64_t", dir: in, role: default} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: length, type: "int64_t", dir: in, role: default} + - name: awkward_UnionArray64_64_regular_index + args: + - {name: toindex, type: "List[int64_t]", dir: out} + - {name: current, type: "List[int64_t]", dir: out} + - {name: size, type: "int64_t", dir: in, role: default} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: length, type: "int64_t", dir: in, role: default} + - name: awkward_UnionArray64_U32_regular_index + args: + - {name: toindex, type: "List[uint32_t]", dir: out} + - {name: current, type: "List[uint32_t]", dir: out} + - {name: size, type: "int64_t", dir: in, role: default} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: length, type: "int64_t", dir: in, role: default} description: null definition: | def awkward_UnionArray_regular_index(toindex, current, size, fromtags, length): @@ -3498,6 +3519,11 @@ kernels: - {name: size, type: "List[int64_t]", dir: out} - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} + - name: awkward_UnionArray64_regular_index_getsize + args: + - {name: size, type: "List[int64_t]", dir: out} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: length, type: "int64_t", dir: in, role: default} description: null definition: | def awkward_UnionArray_regular_index_getsize(size, fromtags, length): diff --git a/tests/test_3312_concatenate_regular_arrays.py b/tests/test_3312_concatenate_regular_arrays.py new file mode 100644 index 0000000000..0f30ba944a --- /dev/null +++ b/tests/test_3312_concatenate_regular_arrays.py @@ -0,0 +1,10 @@ +from __future__ import annotations + +import awkward as ak +import numpy as np + + +def test(): + ak.concatenate([ak.Array([i])[:, np.newaxis] for i in range(127)], axis=1) + + ak.concatenate([ak.Array([i])[:, np.newaxis] for i in range(128)], axis=1) \ No newline at end of file From 693b94b258318ab1b3b42af0b3743f882319f03b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:01:27 +0000 Subject: [PATCH 2/4] style: pre-commit fixes --- tests/test_3312_concatenate_regular_arrays.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_3312_concatenate_regular_arrays.py b/tests/test_3312_concatenate_regular_arrays.py index 0f30ba944a..79b8947a6f 100644 --- a/tests/test_3312_concatenate_regular_arrays.py +++ b/tests/test_3312_concatenate_regular_arrays.py @@ -1,10 +1,11 @@ from __future__ import annotations -import awkward as ak import numpy as np +import awkward as ak + def test(): ak.concatenate([ak.Array([i])[:, np.newaxis] for i in range(127)], axis=1) - ak.concatenate([ak.Array([i])[:, np.newaxis] for i in range(128)], axis=1) \ No newline at end of file + ak.concatenate([ak.Array([i])[:, np.newaxis] for i in range(128)], axis=1) From 664843721f58d8facb770d538044c7bee9644867 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 21 Nov 2024 18:14:13 +0100 Subject: [PATCH 3/4] sort specializations --- .../awkward_UnionArray_regular_index.cpp | 36 +++++++++---------- kernel-specification.yml | 24 ++++++------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp index 3f2db44ab8..362800cf73 100644 --- a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp +++ b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index.cpp @@ -21,78 +21,78 @@ ERROR awkward_UnionArray_regular_index( } return success(); } -ERROR awkward_UnionArray8_32_regular_index( +ERROR awkward_UnionArray64_32_regular_index( int32_t* toindex, int32_t* current, int64_t size, - const int8_t* fromtags, + const int64_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index( + return awkward_UnionArray_regular_index( toindex, current, size, fromtags, length); } -ERROR awkward_UnionArray8_U32_regular_index( +ERROR awkward_UnionArray64_U32_regular_index( uint32_t* toindex, uint32_t* current, int64_t size, - const int8_t* fromtags, + const int64_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index( + return awkward_UnionArray_regular_index( toindex, current, size, fromtags, length); } -ERROR awkward_UnionArray8_64_regular_index( +ERROR awkward_UnionArray64_64_regular_index( int64_t* toindex, int64_t* current, int64_t size, - const int8_t* fromtags, + const int64_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index( + return awkward_UnionArray_regular_index( toindex, current, size, fromtags, length); } -ERROR awkward_UnionArray64_32_regular_index( +ERROR awkward_UnionArray8_32_regular_index( int32_t* toindex, int32_t* current, int64_t size, - const int64_t* fromtags, + const int8_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index( + return awkward_UnionArray_regular_index( toindex, current, size, fromtags, length); } -ERROR awkward_UnionArray64_U32_regular_index( +ERROR awkward_UnionArray8_U32_regular_index( uint32_t* toindex, uint32_t* current, int64_t size, - const int64_t* fromtags, + const int8_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index( + return awkward_UnionArray_regular_index( toindex, current, size, fromtags, length); } -ERROR awkward_UnionArray64_64_regular_index( +ERROR awkward_UnionArray8_64_regular_index( int64_t* toindex, int64_t* current, int64_t size, - const int64_t* fromtags, + const int8_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index( + return awkward_UnionArray_regular_index( toindex, current, size, diff --git a/kernel-specification.yml b/kernel-specification.yml index 5c6f9222ac..eafb308c05 100644 --- a/kernel-specification.yml +++ b/kernel-specification.yml @@ -3458,47 +3458,47 @@ kernels: - name: awkward_UnionArray_regular_index specializations: - - name: awkward_UnionArray8_32_regular_index + - name: awkward_UnionArray64_32_regular_index args: - {name: toindex, type: "List[int32_t]", dir: out} - {name: current, type: "List[int32_t]", dir: out} - {name: size, type: "int64_t", dir: in, role: default} - - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} - - name: awkward_UnionArray8_64_regular_index + - name: awkward_UnionArray64_64_regular_index args: - {name: toindex, type: "List[int64_t]", dir: out} - {name: current, type: "List[int64_t]", dir: out} - {name: size, type: "int64_t", dir: in, role: default} - - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} - - name: awkward_UnionArray8_U32_regular_index + - name: awkward_UnionArray64_U32_regular_index args: - {name: toindex, type: "List[uint32_t]", dir: out} - {name: current, type: "List[uint32_t]", dir: out} - {name: size, type: "int64_t", dir: in, role: default} - - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} - - name: awkward_UnionArray64_32_regular_index + - name: awkward_UnionArray8_32_regular_index args: - {name: toindex, type: "List[int32_t]", dir: out} - {name: current, type: "List[int32_t]", dir: out} - {name: size, type: "int64_t", dir: in, role: default} - - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} - - name: awkward_UnionArray64_64_regular_index + - name: awkward_UnionArray8_64_regular_index args: - {name: toindex, type: "List[int64_t]", dir: out} - {name: current, type: "List[int64_t]", dir: out} - {name: size, type: "int64_t", dir: in, role: default} - - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} - - name: awkward_UnionArray64_U32_regular_index + - name: awkward_UnionArray8_U32_regular_index args: - {name: toindex, type: "List[uint32_t]", dir: out} - {name: current, type: "List[uint32_t]", dir: out} - {name: size, type: "int64_t", dir: in, role: default} - - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} description: null definition: | From 28e222a0e657b2f18ce5b9c42127d3c67ce5b185 Mon Sep 17 00:00:00 2001 From: Ianna Osborne Date: Thu, 21 Nov 2024 18:35:09 +0100 Subject: [PATCH 4/4] sort one more --- .../awkward_UnionArray_regular_index_getsize.cpp | 12 ++++++------ kernel-specification.yml | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp index 355c88a09b..88d40fa49a 100644 --- a/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp +++ b/awkward-cpp/src/cpu-kernels/awkward_UnionArray_regular_index_getsize.cpp @@ -19,20 +19,20 @@ ERROR awkward_UnionArray_regular_index_getsize( *size = *size + 1; return success(); } -ERROR awkward_UnionArray8_regular_index_getsize( +ERROR awkward_UnionArray64_regular_index_getsize( int64_t* size, - const int8_t* fromtags, + const int64_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index_getsize( + return awkward_UnionArray_regular_index_getsize( size, fromtags, length); } -ERROR awkward_UnionArray64_regular_index_getsize( +ERROR awkward_UnionArray8_regular_index_getsize( int64_t* size, - const int64_t* fromtags, + const int8_t* fromtags, int64_t length) { - return awkward_UnionArray_regular_index_getsize( + return awkward_UnionArray_regular_index_getsize( size, fromtags, length); diff --git a/kernel-specification.yml b/kernel-specification.yml index eafb308c05..d95b40a01d 100644 --- a/kernel-specification.yml +++ b/kernel-specification.yml @@ -3514,15 +3514,15 @@ kernels: - name: awkward_UnionArray_regular_index_getsize specializations: - - name: awkward_UnionArray8_regular_index_getsize + - name: awkward_UnionArray64_regular_index_getsize args: - {name: size, type: "List[int64_t]", dir: out} - - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} - - name: awkward_UnionArray64_regular_index_getsize + - name: awkward_UnionArray8_regular_index_getsize args: - {name: size, type: "List[int64_t]", dir: out} - - {name: fromtags, type: "Const[List[int64_t]]", dir: in, role: UnionArray-tags} + - {name: fromtags, type: "Const[List[int8_t]]", dir: in, role: UnionArray-tags} - {name: length, type: "int64_t", dir: in, role: default} description: null definition: |