carray 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +520 -0
- data/README.md +2 -2
- data/carray.gemspec +1 -1
- data/ext/ca_axis_dispatch.c +33 -4
- data/ext/ca_axis_group.c +202 -96
- data/ext/ca_categorical_iterator.c +108 -54
- data/ext/ca_kernel_iterator.c +317 -51
- data/ext/ca_kernel_iterator.h +142 -35
- data/ext/ca_obj_array.c +62 -20
- data/ext/ca_obj_block.c +4 -4
- data/ext/ca_obj_const_string.c +85 -26
- data/ext/ca_obj_face.c +24 -0
- data/ext/ca_obj_face.h +15 -0
- data/ext/ca_obj_fixlen_string.c +18 -5
- data/ext/ca_obj_meld.c +123 -25
- data/ext/ca_obj_object.c +8 -0
- data/ext/ca_obj_select.c +49 -34
- data/ext/ca_obj_stack.c +3 -8
- data/ext/ca_obj_stride.c +72 -1
- data/ext/ca_obj_string.c +8 -4
- data/ext/ca_obj_window.c +8 -2
- data/ext/ca_op_ipower.c +1 -2
- data/ext/ca_rng_normal.h +42 -0
- data/ext/ca_rng_xoshiro256pp.h +105 -0
- data/ext/ca_sweep_engine.c +307 -143
- data/ext/ca_sweep_engine.h +26 -5
- data/ext/carray.h +21 -2
- data/ext/carray_access.c +32 -20
- data/ext/carray_address_basis.c +590 -0
- data/ext/carray_broadcast.c +3 -3
- data/ext/carray_call_cfunc.c +667 -483
- data/ext/carray_cast.c +115 -41
- data/ext/carray_copy.c +55 -30
- data/ext/carray_core.c +83 -3
- data/ext/carray_count.c +9 -10
- data/ext/carray_factorize.c +46 -25
- data/ext/carray_internal.h +17 -0
- data/ext/carray_kernels_reduce_aggregate.c +168 -0
- data/ext/carray_kernels_reduce_cumulative.c +270 -1
- data/ext/carray_kernels_reduce_extreme.c +554 -8
- data/ext/carray_kernels_scan.c +4 -4
- data/ext/carray_kernels_search.c +94 -14
- data/ext/carray_loop.c +7 -1
- data/ext/carray_mask.c +23 -8
- data/ext/carray_median_percentile.c +55 -0
- data/ext/carray_operator.c +4 -4
- data/ext/carray_order.c +1 -1
- data/ext/carray_random.c +384 -40
- data/ext/carray_slab.c +13 -0
- data/ext/carray_sort.c +20 -22
- data/ext/mk_call_cfunc.rb +103 -116
- data/ext/mkkernel.rb +297 -29
- data/ext/ruby_carray.c +10 -1
- data/ext/version.h +4 -4
- data/lib/carray/autoload_carray.rb +5 -3
- data/lib/carray/autoload_method_extension.rb +12 -0
- data/lib/carray/axis_group.rb +77 -0
- data/lib/carray/basics.rb +4 -0
- data/lib/carray/block_iterator.rb +92 -16
- data/lib/carray/categorical.rb +150 -33
- data/lib/carray/categorical_iterator.rb +207 -80
- data/lib/carray/const_string.rb +131 -27
- data/lib/carray/construct.rb +40 -0
- data/lib/carray/data_type_extension.rb +3 -0
- data/lib/carray/data_type_limits.rb +91 -0
- data/lib/carray/fixlen_string.rb +1 -1
- data/lib/carray/frame/csv_parser.rb +11 -4
- data/lib/carray/frame/frame.rb +81 -10
- data/lib/carray/frame/group.rb +36 -3
- data/lib/carray/frame/io.rb +67 -15
- data/lib/carray/frame/records.rb +18 -4
- data/lib/carray/frame/verbs.rb +14 -11
- data/lib/carray/inspect.rb +42 -9
- data/lib/carray/iterator.rb +143 -0
- data/lib/carray/lazy.rb +0 -37
- data/lib/carray/mask_gap_fill.rb +3 -1
- data/lib/carray/methods/discovery_along.rb +74 -0
- data/lib/carray/methods/factorize.rb +50 -0
- data/lib/carray/methods/is_in.rb +13 -2
- data/lib/carray/methods/locate_addr.rb +75 -2
- data/lib/carray/methods/mask_duplicates.rb +35 -1
- data/lib/carray/methods/nunique.rb +22 -1
- data/lib/carray/methods/repeat.rb +110 -0
- data/lib/carray/methods/unique.rb +41 -1
- data/lib/carray/rng.rb +86 -0
- data/lib/carray/slab_iterator.rb +58 -13
- data/lib/carray/string_operation_extension.rb +5 -1
- data/lib/carray/time.rb +18 -2
- data/lib/carray/window_iterator.rb +142 -20
- data/lib/carray.rb +2 -0
- data/yard-stubs/ca_obj_block.rb +2 -7
- data/yard-stubs/ca_obj_window.rb +10 -2
- data/yard-stubs/carray_access.rb +1 -1
- data/yard-stubs/carray_broadcast.rb +1 -1
- data/yard-stubs/carray_core.rb +0 -80
- data/yard-stubs/carray_count.rb +7 -2
- data/yard-stubs/carray_lazy.rb +205 -0
- data/yard-stubs/carray_math.rb +1486 -3
- data/yard-stubs/carray_median_percentile.rb +16 -2
- data/yard-stubs/carray_order.rb +9 -69
- data/yard-stubs/carray_slab.rb +9 -7
- data/yard-stubs/carray_sort.rb +7 -5
- metadata +9 -1
|
@@ -135,6 +135,7 @@ count_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
135
135
|
(void) v;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
+
|
|
138
139
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
139
140
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
140
141
|
}
|
|
@@ -214,6 +215,7 @@ count_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
214
215
|
(void) v;
|
|
215
216
|
}
|
|
216
217
|
}
|
|
218
|
+
|
|
217
219
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
218
220
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
219
221
|
}
|
|
@@ -339,6 +341,7 @@ count_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
339
341
|
(void) v;
|
|
340
342
|
}
|
|
341
343
|
}
|
|
344
|
+
|
|
342
345
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
343
346
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
344
347
|
}
|
|
@@ -499,6 +502,7 @@ count_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
499
502
|
(void) v;
|
|
500
503
|
}
|
|
501
504
|
}
|
|
505
|
+
|
|
502
506
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
503
507
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
504
508
|
}
|
|
@@ -640,6 +644,7 @@ count_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
640
644
|
(void) v;
|
|
641
645
|
}
|
|
642
646
|
}
|
|
647
|
+
|
|
643
648
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
644
649
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
645
650
|
}
|
|
@@ -719,6 +724,7 @@ count_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
719
724
|
(void) v;
|
|
720
725
|
}
|
|
721
726
|
}
|
|
727
|
+
|
|
722
728
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
723
729
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
724
730
|
}
|
|
@@ -844,6 +850,7 @@ count_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
844
850
|
(void) v;
|
|
845
851
|
}
|
|
846
852
|
}
|
|
853
|
+
|
|
847
854
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
848
855
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
849
856
|
}
|
|
@@ -1004,6 +1011,7 @@ count_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int
|
|
|
1004
1011
|
(void) v;
|
|
1005
1012
|
}
|
|
1006
1013
|
}
|
|
1014
|
+
|
|
1007
1015
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1008
1016
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1009
1017
|
}
|
|
@@ -1145,6 +1153,7 @@ count_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1145
1153
|
(void) v;
|
|
1146
1154
|
}
|
|
1147
1155
|
}
|
|
1156
|
+
|
|
1148
1157
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1149
1158
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1150
1159
|
}
|
|
@@ -1224,6 +1233,7 @@ count_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1224
1233
|
(void) v;
|
|
1225
1234
|
}
|
|
1226
1235
|
}
|
|
1236
|
+
|
|
1227
1237
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1228
1238
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1229
1239
|
}
|
|
@@ -1349,6 +1359,7 @@ count_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1349
1359
|
(void) v;
|
|
1350
1360
|
}
|
|
1351
1361
|
}
|
|
1362
|
+
|
|
1352
1363
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1353
1364
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1354
1365
|
}
|
|
@@ -1509,6 +1520,7 @@ count_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1509
1520
|
(void) v;
|
|
1510
1521
|
}
|
|
1511
1522
|
}
|
|
1523
|
+
|
|
1512
1524
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1513
1525
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1514
1526
|
}
|
|
@@ -1650,6 +1662,7 @@ count_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1650
1662
|
(void) v;
|
|
1651
1663
|
}
|
|
1652
1664
|
}
|
|
1665
|
+
|
|
1653
1666
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1654
1667
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1655
1668
|
}
|
|
@@ -1729,6 +1742,7 @@ count_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1729
1742
|
(void) v;
|
|
1730
1743
|
}
|
|
1731
1744
|
}
|
|
1745
|
+
|
|
1732
1746
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1733
1747
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1734
1748
|
}
|
|
@@ -1854,6 +1868,7 @@ count_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
1854
1868
|
(void) v;
|
|
1855
1869
|
}
|
|
1856
1870
|
}
|
|
1871
|
+
|
|
1857
1872
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
1858
1873
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
1859
1874
|
}
|
|
@@ -2014,6 +2029,7 @@ count_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2014
2029
|
(void) v;
|
|
2015
2030
|
}
|
|
2016
2031
|
}
|
|
2032
|
+
|
|
2017
2033
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2018
2034
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2019
2035
|
}
|
|
@@ -2155,6 +2171,7 @@ count_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2155
2171
|
(void) v;
|
|
2156
2172
|
}
|
|
2157
2173
|
}
|
|
2174
|
+
|
|
2158
2175
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2159
2176
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2160
2177
|
}
|
|
@@ -2234,6 +2251,7 @@ count_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2234
2251
|
(void) v;
|
|
2235
2252
|
}
|
|
2236
2253
|
}
|
|
2254
|
+
|
|
2237
2255
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2238
2256
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2239
2257
|
}
|
|
@@ -2359,6 +2377,7 @@ count_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2359
2377
|
(void) v;
|
|
2360
2378
|
}
|
|
2361
2379
|
}
|
|
2380
|
+
|
|
2362
2381
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2363
2382
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2364
2383
|
}
|
|
@@ -2519,6 +2538,7 @@ count_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2519
2538
|
(void) v;
|
|
2520
2539
|
}
|
|
2521
2540
|
}
|
|
2541
|
+
|
|
2522
2542
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2523
2543
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2524
2544
|
}
|
|
@@ -2660,6 +2680,7 @@ count_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2660
2680
|
(void) v;
|
|
2661
2681
|
}
|
|
2662
2682
|
}
|
|
2683
|
+
|
|
2663
2684
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2664
2685
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2665
2686
|
}
|
|
@@ -2739,6 +2760,7 @@ count_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2739
2760
|
(void) v;
|
|
2740
2761
|
}
|
|
2741
2762
|
}
|
|
2763
|
+
|
|
2742
2764
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2743
2765
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2744
2766
|
}
|
|
@@ -2864,6 +2886,7 @@ count_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
2864
2886
|
(void) v;
|
|
2865
2887
|
}
|
|
2866
2888
|
}
|
|
2889
|
+
|
|
2867
2890
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
2868
2891
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
2869
2892
|
}
|
|
@@ -3024,6 +3047,7 @@ count_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3024
3047
|
(void) v;
|
|
3025
3048
|
}
|
|
3026
3049
|
}
|
|
3050
|
+
|
|
3027
3051
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3028
3052
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3029
3053
|
}
|
|
@@ -3165,6 +3189,7 @@ count_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3165
3189
|
(void) v;
|
|
3166
3190
|
}
|
|
3167
3191
|
}
|
|
3192
|
+
|
|
3168
3193
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3169
3194
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3170
3195
|
}
|
|
@@ -3244,6 +3269,7 @@ count_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3244
3269
|
(void) v;
|
|
3245
3270
|
}
|
|
3246
3271
|
}
|
|
3272
|
+
|
|
3247
3273
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3248
3274
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3249
3275
|
}
|
|
@@ -3369,6 +3395,7 @@ count_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3369
3395
|
(void) v;
|
|
3370
3396
|
}
|
|
3371
3397
|
}
|
|
3398
|
+
|
|
3372
3399
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3373
3400
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3374
3401
|
}
|
|
@@ -3529,6 +3556,7 @@ count_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3529
3556
|
(void) v;
|
|
3530
3557
|
}
|
|
3531
3558
|
}
|
|
3559
|
+
|
|
3532
3560
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3533
3561
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3534
3562
|
}
|
|
@@ -3670,6 +3698,7 @@ count_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3670
3698
|
(void) v;
|
|
3671
3699
|
}
|
|
3672
3700
|
}
|
|
3701
|
+
|
|
3673
3702
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3674
3703
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3675
3704
|
}
|
|
@@ -3749,6 +3778,7 @@ count_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3749
3778
|
(void) v;
|
|
3750
3779
|
}
|
|
3751
3780
|
}
|
|
3781
|
+
|
|
3752
3782
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3753
3783
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3754
3784
|
}
|
|
@@ -3874,6 +3904,7 @@ count_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
3874
3904
|
(void) v;
|
|
3875
3905
|
}
|
|
3876
3906
|
}
|
|
3907
|
+
|
|
3877
3908
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
3878
3909
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
3879
3910
|
}
|
|
@@ -4034,6 +4065,7 @@ count_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4034
4065
|
(void) v;
|
|
4035
4066
|
}
|
|
4036
4067
|
}
|
|
4068
|
+
|
|
4037
4069
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4038
4070
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4039
4071
|
}
|
|
@@ -4175,6 +4207,7 @@ count_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4175
4207
|
(void) v;
|
|
4176
4208
|
}
|
|
4177
4209
|
}
|
|
4210
|
+
|
|
4178
4211
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4179
4212
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4180
4213
|
}
|
|
@@ -4254,6 +4287,7 @@ count_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4254
4287
|
(void) v;
|
|
4255
4288
|
}
|
|
4256
4289
|
}
|
|
4290
|
+
|
|
4257
4291
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4258
4292
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4259
4293
|
}
|
|
@@ -4379,6 +4413,7 @@ count_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4379
4413
|
(void) v;
|
|
4380
4414
|
}
|
|
4381
4415
|
}
|
|
4416
|
+
|
|
4382
4417
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4383
4418
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4384
4419
|
}
|
|
@@ -4539,6 +4574,7 @@ count_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4539
4574
|
(void) v;
|
|
4540
4575
|
}
|
|
4541
4576
|
}
|
|
4577
|
+
|
|
4542
4578
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4543
4579
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4544
4580
|
}
|
|
@@ -4680,6 +4716,7 @@ count_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4680
4716
|
(void) v;
|
|
4681
4717
|
}
|
|
4682
4718
|
}
|
|
4719
|
+
|
|
4683
4720
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4684
4721
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4685
4722
|
}
|
|
@@ -4759,6 +4796,7 @@ count_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4759
4796
|
(void) v;
|
|
4760
4797
|
}
|
|
4761
4798
|
}
|
|
4799
|
+
|
|
4762
4800
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4763
4801
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4764
4802
|
}
|
|
@@ -4884,6 +4922,7 @@ count_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
4884
4922
|
(void) v;
|
|
4885
4923
|
}
|
|
4886
4924
|
}
|
|
4925
|
+
|
|
4887
4926
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
4888
4927
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
4889
4928
|
}
|
|
@@ -5044,6 +5083,7 @@ count_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, in
|
|
|
5044
5083
|
(void) v;
|
|
5045
5084
|
}
|
|
5046
5085
|
}
|
|
5086
|
+
|
|
5047
5087
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5048
5088
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
5049
5089
|
}
|
|
@@ -5233,6 +5273,7 @@ accumulate_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5233
5273
|
(void) v;
|
|
5234
5274
|
}
|
|
5235
5275
|
}
|
|
5276
|
+
|
|
5236
5277
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5237
5278
|
op[__li_o * __li_INNER + __li_tile + __j] = (int8_t) (__li_buf_acc[__j]);
|
|
5238
5279
|
}
|
|
@@ -5312,6 +5353,7 @@ accumulate_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5312
5353
|
(void) v;
|
|
5313
5354
|
}
|
|
5314
5355
|
}
|
|
5356
|
+
|
|
5315
5357
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5316
5358
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int8_t) (__li_buf_acc[__j]);
|
|
5317
5359
|
}
|
|
@@ -5437,6 +5479,7 @@ accumulate_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5437
5479
|
(void) v;
|
|
5438
5480
|
}
|
|
5439
5481
|
}
|
|
5482
|
+
|
|
5440
5483
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5441
5484
|
__li_op_k[__li_tile + __j] = (int8_t) (__li_buf_acc[__j]);
|
|
5442
5485
|
}
|
|
@@ -5597,6 +5640,7 @@ accumulate_ki_native_i8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5597
5640
|
(void) v;
|
|
5598
5641
|
}
|
|
5599
5642
|
}
|
|
5643
|
+
|
|
5600
5644
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5601
5645
|
__li_op_k[__li_tile + __j] = (int8_t) (__li_buf_acc[__j]);
|
|
5602
5646
|
}
|
|
@@ -5752,6 +5796,7 @@ accumulate_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5752
5796
|
(void) v;
|
|
5753
5797
|
}
|
|
5754
5798
|
}
|
|
5799
|
+
|
|
5755
5800
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5756
5801
|
op[__li_o * __li_INNER + __li_tile + __j] = (uint8_t) (__li_buf_acc[__j]);
|
|
5757
5802
|
}
|
|
@@ -5831,6 +5876,7 @@ accumulate_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5831
5876
|
(void) v;
|
|
5832
5877
|
}
|
|
5833
5878
|
}
|
|
5879
|
+
|
|
5834
5880
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5835
5881
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (uint8_t) (__li_buf_acc[__j]);
|
|
5836
5882
|
}
|
|
@@ -5956,6 +6002,7 @@ accumulate_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
5956
6002
|
(void) v;
|
|
5957
6003
|
}
|
|
5958
6004
|
}
|
|
6005
|
+
|
|
5959
6006
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
5960
6007
|
__li_op_k[__li_tile + __j] = (uint8_t) (__li_buf_acc[__j]);
|
|
5961
6008
|
}
|
|
@@ -6116,6 +6163,7 @@ accumulate_ki_native_u8 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes
|
|
|
6116
6163
|
(void) v;
|
|
6117
6164
|
}
|
|
6118
6165
|
}
|
|
6166
|
+
|
|
6119
6167
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6120
6168
|
__li_op_k[__li_tile + __j] = (uint8_t) (__li_buf_acc[__j]);
|
|
6121
6169
|
}
|
|
@@ -6271,6 +6319,7 @@ accumulate_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6271
6319
|
(void) v;
|
|
6272
6320
|
}
|
|
6273
6321
|
}
|
|
6322
|
+
|
|
6274
6323
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6275
6324
|
op[__li_o * __li_INNER + __li_tile + __j] = (int16_t) (__li_buf_acc[__j]);
|
|
6276
6325
|
}
|
|
@@ -6350,6 +6399,7 @@ accumulate_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6350
6399
|
(void) v;
|
|
6351
6400
|
}
|
|
6352
6401
|
}
|
|
6402
|
+
|
|
6353
6403
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6354
6404
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int16_t) (__li_buf_acc[__j]);
|
|
6355
6405
|
}
|
|
@@ -6475,6 +6525,7 @@ accumulate_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6475
6525
|
(void) v;
|
|
6476
6526
|
}
|
|
6477
6527
|
}
|
|
6528
|
+
|
|
6478
6529
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6479
6530
|
__li_op_k[__li_tile + __j] = (int16_t) (__li_buf_acc[__j]);
|
|
6480
6531
|
}
|
|
@@ -6635,6 +6686,7 @@ accumulate_ki_native_i16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6635
6686
|
(void) v;
|
|
6636
6687
|
}
|
|
6637
6688
|
}
|
|
6689
|
+
|
|
6638
6690
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6639
6691
|
__li_op_k[__li_tile + __j] = (int16_t) (__li_buf_acc[__j]);
|
|
6640
6692
|
}
|
|
@@ -6790,6 +6842,7 @@ accumulate_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6790
6842
|
(void) v;
|
|
6791
6843
|
}
|
|
6792
6844
|
}
|
|
6845
|
+
|
|
6793
6846
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6794
6847
|
op[__li_o * __li_INNER + __li_tile + __j] = (uint16_t) (__li_buf_acc[__j]);
|
|
6795
6848
|
}
|
|
@@ -6869,6 +6922,7 @@ accumulate_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6869
6922
|
(void) v;
|
|
6870
6923
|
}
|
|
6871
6924
|
}
|
|
6925
|
+
|
|
6872
6926
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6873
6927
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (uint16_t) (__li_buf_acc[__j]);
|
|
6874
6928
|
}
|
|
@@ -6994,6 +7048,7 @@ accumulate_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
6994
7048
|
(void) v;
|
|
6995
7049
|
}
|
|
6996
7050
|
}
|
|
7051
|
+
|
|
6997
7052
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
6998
7053
|
__li_op_k[__li_tile + __j] = (uint16_t) (__li_buf_acc[__j]);
|
|
6999
7054
|
}
|
|
@@ -7154,6 +7209,7 @@ accumulate_ki_native_u16 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7154
7209
|
(void) v;
|
|
7155
7210
|
}
|
|
7156
7211
|
}
|
|
7212
|
+
|
|
7157
7213
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7158
7214
|
__li_op_k[__li_tile + __j] = (uint16_t) (__li_buf_acc[__j]);
|
|
7159
7215
|
}
|
|
@@ -7309,6 +7365,7 @@ accumulate_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7309
7365
|
(void) v;
|
|
7310
7366
|
}
|
|
7311
7367
|
}
|
|
7368
|
+
|
|
7312
7369
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7313
7370
|
op[__li_o * __li_INNER + __li_tile + __j] = (int32_t) (__li_buf_acc[__j]);
|
|
7314
7371
|
}
|
|
@@ -7388,6 +7445,7 @@ accumulate_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7388
7445
|
(void) v;
|
|
7389
7446
|
}
|
|
7390
7447
|
}
|
|
7448
|
+
|
|
7391
7449
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7392
7450
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int32_t) (__li_buf_acc[__j]);
|
|
7393
7451
|
}
|
|
@@ -7513,6 +7571,7 @@ accumulate_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7513
7571
|
(void) v;
|
|
7514
7572
|
}
|
|
7515
7573
|
}
|
|
7574
|
+
|
|
7516
7575
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7517
7576
|
__li_op_k[__li_tile + __j] = (int32_t) (__li_buf_acc[__j]);
|
|
7518
7577
|
}
|
|
@@ -7673,6 +7732,7 @@ accumulate_ki_native_i32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7673
7732
|
(void) v;
|
|
7674
7733
|
}
|
|
7675
7734
|
}
|
|
7735
|
+
|
|
7676
7736
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7677
7737
|
__li_op_k[__li_tile + __j] = (int32_t) (__li_buf_acc[__j]);
|
|
7678
7738
|
}
|
|
@@ -7828,6 +7888,7 @@ accumulate_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7828
7888
|
(void) v;
|
|
7829
7889
|
}
|
|
7830
7890
|
}
|
|
7891
|
+
|
|
7831
7892
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7832
7893
|
op[__li_o * __li_INNER + __li_tile + __j] = (uint32_t) (__li_buf_acc[__j]);
|
|
7833
7894
|
}
|
|
@@ -7907,6 +7968,7 @@ accumulate_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
7907
7968
|
(void) v;
|
|
7908
7969
|
}
|
|
7909
7970
|
}
|
|
7971
|
+
|
|
7910
7972
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
7911
7973
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (uint32_t) (__li_buf_acc[__j]);
|
|
7912
7974
|
}
|
|
@@ -8032,6 +8094,7 @@ accumulate_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8032
8094
|
(void) v;
|
|
8033
8095
|
}
|
|
8034
8096
|
}
|
|
8097
|
+
|
|
8035
8098
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8036
8099
|
__li_op_k[__li_tile + __j] = (uint32_t) (__li_buf_acc[__j]);
|
|
8037
8100
|
}
|
|
@@ -8192,6 +8255,7 @@ accumulate_ki_native_u32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8192
8255
|
(void) v;
|
|
8193
8256
|
}
|
|
8194
8257
|
}
|
|
8258
|
+
|
|
8195
8259
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8196
8260
|
__li_op_k[__li_tile + __j] = (uint32_t) (__li_buf_acc[__j]);
|
|
8197
8261
|
}
|
|
@@ -8347,6 +8411,7 @@ accumulate_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8347
8411
|
(void) v;
|
|
8348
8412
|
}
|
|
8349
8413
|
}
|
|
8414
|
+
|
|
8350
8415
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8351
8416
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
8352
8417
|
}
|
|
@@ -8426,6 +8491,7 @@ accumulate_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8426
8491
|
(void) v;
|
|
8427
8492
|
}
|
|
8428
8493
|
}
|
|
8494
|
+
|
|
8429
8495
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8430
8496
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
8431
8497
|
}
|
|
@@ -8551,6 +8617,7 @@ accumulate_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8551
8617
|
(void) v;
|
|
8552
8618
|
}
|
|
8553
8619
|
}
|
|
8620
|
+
|
|
8554
8621
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8555
8622
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
8556
8623
|
}
|
|
@@ -8711,6 +8778,7 @@ accumulate_ki_native_i64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8711
8778
|
(void) v;
|
|
8712
8779
|
}
|
|
8713
8780
|
}
|
|
8781
|
+
|
|
8714
8782
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8715
8783
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
8716
8784
|
}
|
|
@@ -8866,6 +8934,7 @@ accumulate_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8866
8934
|
(void) v;
|
|
8867
8935
|
}
|
|
8868
8936
|
}
|
|
8937
|
+
|
|
8869
8938
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8870
8939
|
op[__li_o * __li_INNER + __li_tile + __j] = (uint64_t) (__li_buf_acc[__j]);
|
|
8871
8940
|
}
|
|
@@ -8945,6 +9014,7 @@ accumulate_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
8945
9014
|
(void) v;
|
|
8946
9015
|
}
|
|
8947
9016
|
}
|
|
9017
|
+
|
|
8948
9018
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
8949
9019
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (uint64_t) (__li_buf_acc[__j]);
|
|
8950
9020
|
}
|
|
@@ -9070,6 +9140,7 @@ accumulate_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9070
9140
|
(void) v;
|
|
9071
9141
|
}
|
|
9072
9142
|
}
|
|
9143
|
+
|
|
9073
9144
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9074
9145
|
__li_op_k[__li_tile + __j] = (uint64_t) (__li_buf_acc[__j]);
|
|
9075
9146
|
}
|
|
@@ -9230,6 +9301,7 @@ accumulate_ki_native_u64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9230
9301
|
(void) v;
|
|
9231
9302
|
}
|
|
9232
9303
|
}
|
|
9304
|
+
|
|
9233
9305
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9234
9306
|
__li_op_k[__li_tile + __j] = (uint64_t) (__li_buf_acc[__j]);
|
|
9235
9307
|
}
|
|
@@ -9385,6 +9457,7 @@ accumulate_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9385
9457
|
(void) v;
|
|
9386
9458
|
}
|
|
9387
9459
|
}
|
|
9460
|
+
|
|
9388
9461
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9389
9462
|
op[__li_o * __li_INNER + __li_tile + __j] = (float) (__li_buf_acc[__j]);
|
|
9390
9463
|
}
|
|
@@ -9464,6 +9537,7 @@ accumulate_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9464
9537
|
(void) v;
|
|
9465
9538
|
}
|
|
9466
9539
|
}
|
|
9540
|
+
|
|
9467
9541
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9468
9542
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (float) (__li_buf_acc[__j]);
|
|
9469
9543
|
}
|
|
@@ -9589,6 +9663,7 @@ accumulate_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9589
9663
|
(void) v;
|
|
9590
9664
|
}
|
|
9591
9665
|
}
|
|
9666
|
+
|
|
9592
9667
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9593
9668
|
__li_op_k[__li_tile + __j] = (float) (__li_buf_acc[__j]);
|
|
9594
9669
|
}
|
|
@@ -9749,6 +9824,7 @@ accumulate_ki_native_f32 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9749
9824
|
(void) v;
|
|
9750
9825
|
}
|
|
9751
9826
|
}
|
|
9827
|
+
|
|
9752
9828
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9753
9829
|
__li_op_k[__li_tile + __j] = (float) (__li_buf_acc[__j]);
|
|
9754
9830
|
}
|
|
@@ -9904,6 +9980,7 @@ accumulate_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9904
9980
|
(void) v;
|
|
9905
9981
|
}
|
|
9906
9982
|
}
|
|
9983
|
+
|
|
9907
9984
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9908
9985
|
op[__li_o * __li_INNER + __li_tile + __j] = (double) (__li_buf_acc[__j]);
|
|
9909
9986
|
}
|
|
@@ -9983,6 +10060,7 @@ accumulate_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
9983
10060
|
(void) v;
|
|
9984
10061
|
}
|
|
9985
10062
|
}
|
|
10063
|
+
|
|
9986
10064
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
9987
10065
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (double) (__li_buf_acc[__j]);
|
|
9988
10066
|
}
|
|
@@ -10108,6 +10186,7 @@ accumulate_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
10108
10186
|
(void) v;
|
|
10109
10187
|
}
|
|
10110
10188
|
}
|
|
10189
|
+
|
|
10111
10190
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10112
10191
|
__li_op_k[__li_tile + __j] = (double) (__li_buf_acc[__j]);
|
|
10113
10192
|
}
|
|
@@ -10268,6 +10347,7 @@ accumulate_ki_native_f64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxe
|
|
|
10268
10347
|
(void) v;
|
|
10269
10348
|
}
|
|
10270
10349
|
}
|
|
10350
|
+
|
|
10271
10351
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10272
10352
|
__li_op_k[__li_tile + __j] = (double) (__li_buf_acc[__j]);
|
|
10273
10353
|
}
|
|
@@ -10423,6 +10503,7 @@ accumulate_ki_native_cmplx64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
10423
10503
|
(void) v;
|
|
10424
10504
|
}
|
|
10425
10505
|
}
|
|
10506
|
+
|
|
10426
10507
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10427
10508
|
op[__li_o * __li_INNER + __li_tile + __j] = (cmplx64_t) (__li_buf_acc[__j]);
|
|
10428
10509
|
}
|
|
@@ -10502,6 +10583,7 @@ accumulate_ki_native_cmplx64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
10502
10583
|
(void) v;
|
|
10503
10584
|
}
|
|
10504
10585
|
}
|
|
10586
|
+
|
|
10505
10587
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10506
10588
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (cmplx64_t) (__li_buf_acc[__j]);
|
|
10507
10589
|
}
|
|
@@ -10627,6 +10709,7 @@ accumulate_ki_native_cmplx64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
10627
10709
|
(void) v;
|
|
10628
10710
|
}
|
|
10629
10711
|
}
|
|
10712
|
+
|
|
10630
10713
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10631
10714
|
__li_op_k[__li_tile + __j] = (cmplx64_t) (__li_buf_acc[__j]);
|
|
10632
10715
|
}
|
|
@@ -10787,6 +10870,7 @@ accumulate_ki_native_cmplx64 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
10787
10870
|
(void) v;
|
|
10788
10871
|
}
|
|
10789
10872
|
}
|
|
10873
|
+
|
|
10790
10874
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10791
10875
|
__li_op_k[__li_tile + __j] = (cmplx64_t) (__li_buf_acc[__j]);
|
|
10792
10876
|
}
|
|
@@ -10942,6 +11026,7 @@ accumulate_ki_native_cmplx128 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
10942
11026
|
(void) v;
|
|
10943
11027
|
}
|
|
10944
11028
|
}
|
|
11029
|
+
|
|
10945
11030
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
10946
11031
|
op[__li_o * __li_INNER + __li_tile + __j] = (cmplx128_t) (__li_buf_acc[__j]);
|
|
10947
11032
|
}
|
|
@@ -11021,6 +11106,7 @@ accumulate_ki_native_cmplx128 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
11021
11106
|
(void) v;
|
|
11022
11107
|
}
|
|
11023
11108
|
}
|
|
11109
|
+
|
|
11024
11110
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11025
11111
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (cmplx128_t) (__li_buf_acc[__j]);
|
|
11026
11112
|
}
|
|
@@ -11146,6 +11232,7 @@ accumulate_ki_native_cmplx128 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
11146
11232
|
(void) v;
|
|
11147
11233
|
}
|
|
11148
11234
|
}
|
|
11235
|
+
|
|
11149
11236
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11150
11237
|
__li_op_k[__li_tile + __j] = (cmplx128_t) (__li_buf_acc[__j]);
|
|
11151
11238
|
}
|
|
@@ -11306,6 +11393,7 @@ accumulate_ki_native_cmplx128 (VALUE self, CArray *ca, int8_t *slab_axes, int8_t
|
|
|
11306
11393
|
(void) v;
|
|
11307
11394
|
}
|
|
11308
11395
|
}
|
|
11396
|
+
|
|
11309
11397
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11310
11398
|
__li_op_k[__li_tile + __j] = (cmplx128_t) (__li_buf_acc[__j]);
|
|
11311
11399
|
}
|
|
@@ -11461,6 +11549,7 @@ accumulate_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
11461
11549
|
(void) v;
|
|
11462
11550
|
}
|
|
11463
11551
|
}
|
|
11552
|
+
|
|
11464
11553
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11465
11554
|
op[__li_o * __li_INNER + __li_tile + __j] = (boolean8_t) (__li_buf_acc[__j]);
|
|
11466
11555
|
}
|
|
@@ -11540,6 +11629,7 @@ accumulate_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
11540
11629
|
(void) v;
|
|
11541
11630
|
}
|
|
11542
11631
|
}
|
|
11632
|
+
|
|
11543
11633
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11544
11634
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (boolean8_t) (__li_buf_acc[__j]);
|
|
11545
11635
|
}
|
|
@@ -11665,6 +11755,7 @@ accumulate_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
11665
11755
|
(void) v;
|
|
11666
11756
|
}
|
|
11667
11757
|
}
|
|
11758
|
+
|
|
11668
11759
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11669
11760
|
__li_op_k[__li_tile + __j] = (boolean8_t) (__li_buf_acc[__j]);
|
|
11670
11761
|
}
|
|
@@ -11825,6 +11916,7 @@ accumulate_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
11825
11916
|
(void) v;
|
|
11826
11917
|
}
|
|
11827
11918
|
}
|
|
11919
|
+
|
|
11828
11920
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11829
11921
|
__li_op_k[__li_tile + __j] = (boolean8_t) (__li_buf_acc[__j]);
|
|
11830
11922
|
}
|
|
@@ -11978,6 +12070,7 @@ accumulate_ki_native_object (VALUE self, CArray *ca, int8_t *slab_axes, int8_t n
|
|
|
11978
12070
|
(void) v;
|
|
11979
12071
|
}
|
|
11980
12072
|
}
|
|
12073
|
+
|
|
11981
12074
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
11982
12075
|
op[__li_o * __li_INNER + __li_tile + __j] = (VALUE) (__li_buf_acc[__j]);
|
|
11983
12076
|
}
|
|
@@ -12057,6 +12150,7 @@ accumulate_ki_native_object (VALUE self, CArray *ca, int8_t *slab_axes, int8_t n
|
|
|
12057
12150
|
(void) v;
|
|
12058
12151
|
}
|
|
12059
12152
|
}
|
|
12153
|
+
|
|
12060
12154
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12061
12155
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (VALUE) (__li_buf_acc[__j]);
|
|
12062
12156
|
}
|
|
@@ -12182,6 +12276,7 @@ accumulate_ki_native_object (VALUE self, CArray *ca, int8_t *slab_axes, int8_t n
|
|
|
12182
12276
|
(void) v;
|
|
12183
12277
|
}
|
|
12184
12278
|
}
|
|
12279
|
+
|
|
12185
12280
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12186
12281
|
__li_op_k[__li_tile + __j] = (VALUE) (__li_buf_acc[__j]);
|
|
12187
12282
|
}
|
|
@@ -12342,6 +12437,7 @@ accumulate_ki_native_object (VALUE self, CArray *ca, int8_t *slab_axes, int8_t n
|
|
|
12342
12437
|
(void) v;
|
|
12343
12438
|
}
|
|
12344
12439
|
}
|
|
12440
|
+
|
|
12345
12441
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12346
12442
|
__li_op_k[__li_tile + __j] = (VALUE) (__li_buf_acc[__j]);
|
|
12347
12443
|
}
|
|
@@ -12595,6 +12691,7 @@ count_true_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
12595
12691
|
(void) v;
|
|
12596
12692
|
}
|
|
12597
12693
|
}
|
|
12694
|
+
|
|
12598
12695
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12599
12696
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
12600
12697
|
}
|
|
@@ -12674,6 +12771,7 @@ count_true_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
12674
12771
|
(void) v;
|
|
12675
12772
|
}
|
|
12676
12773
|
}
|
|
12774
|
+
|
|
12677
12775
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12678
12776
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
12679
12777
|
}
|
|
@@ -12799,6 +12897,7 @@ count_true_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
12799
12897
|
(void) v;
|
|
12800
12898
|
}
|
|
12801
12899
|
}
|
|
12900
|
+
|
|
12802
12901
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12803
12902
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
12804
12903
|
}
|
|
@@ -12959,6 +13058,7 @@ count_true_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t nax
|
|
|
12959
13058
|
(void) v;
|
|
12960
13059
|
}
|
|
12961
13060
|
}
|
|
13061
|
+
|
|
12962
13062
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
12963
13063
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
12964
13064
|
}
|
|
@@ -13162,6 +13262,7 @@ count_false_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t na
|
|
|
13162
13262
|
(void) v;
|
|
13163
13263
|
}
|
|
13164
13264
|
}
|
|
13265
|
+
|
|
13165
13266
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
13166
13267
|
op[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
13167
13268
|
}
|
|
@@ -13241,6 +13342,7 @@ count_false_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t na
|
|
|
13241
13342
|
(void) v;
|
|
13242
13343
|
}
|
|
13243
13344
|
}
|
|
13345
|
+
|
|
13244
13346
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
13245
13347
|
__li_op_k[__li_o * __li_INNER + __li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
13246
13348
|
}
|
|
@@ -13366,6 +13468,7 @@ count_false_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t na
|
|
|
13366
13468
|
(void) v;
|
|
13367
13469
|
}
|
|
13368
13470
|
}
|
|
13471
|
+
|
|
13369
13472
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
13370
13473
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
13371
13474
|
}
|
|
@@ -13526,6 +13629,7 @@ count_false_ki_native_bool (VALUE self, CArray *ca, int8_t *slab_axes, int8_t na
|
|
|
13526
13629
|
(void) v;
|
|
13527
13630
|
}
|
|
13528
13631
|
}
|
|
13632
|
+
|
|
13529
13633
|
for ( ca_size_t __j = 0; __j < __li_tile_len; __j++ ) {
|
|
13530
13634
|
__li_op_k[__li_tile + __j] = (int64_t) (__li_buf_acc[__j]);
|
|
13531
13635
|
}
|
|
@@ -14488,6 +14592,160 @@ ca_size_t out_i = 0;
|
|
|
14488
14592
|
return vout;
|
|
14489
14593
|
}
|
|
14490
14594
|
|
|
14595
|
+
static VALUE
|
|
14596
|
+
count_equal_ki_native_object (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int keep_axis, VALUE value_arg, ca_size_t min_count)
|
|
14597
|
+
{
|
|
14598
|
+
/* P.4.5.3b/c streaming chunked reduce: full reduction over lazy unmasked. */
|
|
14599
|
+
/* P.4.5.3c (N-D): outer-axis chunking, 1-D is the natural sub-case. */
|
|
14600
|
+
if ( naxes == ca->ndim && ca->ndim >= 1 && !keep_axis &&
|
|
14601
|
+
ca_is_lazy_view(ca) && ! ca_has_mask(ca) ) {
|
|
14602
|
+
ca_size_t __inner = 1;
|
|
14603
|
+
int __k;
|
|
14604
|
+
for ( __k = 1; __k < ca->ndim; __k++ ) __inner *= ca->dim[__k];
|
|
14605
|
+
ca_size_t __target = 4096; /* L1d-friendly element budget (32KB for f64) */
|
|
14606
|
+
ca_size_t __rows = (__inner > 0) ? (__target / __inner) : __target;
|
|
14607
|
+
if ( __rows < 1 ) __rows = 1; /* at least one row per chunk */
|
|
14608
|
+
ca_size_t __chunk_elems = __rows * __inner;
|
|
14609
|
+
ca_size_t __outer = ca->dim[0];
|
|
14610
|
+
ca_size_t __starts[CA_RANK_MAX] = {0};
|
|
14611
|
+
ca_size_t __counts[CA_RANK_MAX];
|
|
14612
|
+
ca_size_t __strides[CA_RANK_MAX];
|
|
14613
|
+
ca_size_t __s = sizeof(VALUE);
|
|
14614
|
+
for ( __k = ca->ndim - 1; __k >= 0; __k-- ) {
|
|
14615
|
+
__strides[__k] = __s;
|
|
14616
|
+
__s *= ca->dim[__k];
|
|
14617
|
+
}
|
|
14618
|
+
for ( __k = 1; __k < ca->ndim; __k++ ) __counts[__k] = ca->dim[__k];
|
|
14619
|
+
ca_size_t __outer_off = 0;
|
|
14620
|
+
int64_t acc;
|
|
14621
|
+
acc = (0);
|
|
14622
|
+
ca_size_t masked_cnt = 0; /* unused on streaming (no mask) */
|
|
14623
|
+
(void) masked_cnt;
|
|
14624
|
+
ca_lazy_arena_enter();
|
|
14625
|
+
VALUE *__chunk = (VALUE *) ca_lazy_arena_acquire_object(__chunk_elems);
|
|
14626
|
+
while ( __outer_off < __outer ) {
|
|
14627
|
+
ca_size_t __r = (__outer - __outer_off < __rows) ? (__outer - __outer_off) : __rows;
|
|
14628
|
+
ca_size_t __n = __r * __inner;
|
|
14629
|
+
__starts[0] = __outer_off;
|
|
14630
|
+
__counts[0] = __r;
|
|
14631
|
+
ca_xfer_stride(ca, __starts, __counts, __strides, __chunk, CA_XFER_GET);
|
|
14632
|
+
ca_size_t __i;
|
|
14633
|
+
for ( __i = 0; __i < __n; __i++ ) {
|
|
14634
|
+
VALUE v = __chunk[__i];
|
|
14635
|
+
if (RTEST(rb_equal(v, value_arg))) acc += 1;
|
|
14636
|
+
}
|
|
14637
|
+
__outer_off += __r;
|
|
14638
|
+
}
|
|
14639
|
+
ca_lazy_arena_release(__chunk);
|
|
14640
|
+
ca_lazy_arena_exit();
|
|
14641
|
+
return LL2NUM((int64_t) (acc));
|
|
14642
|
+
}
|
|
14643
|
+
VALUE vout = rb_ca_new_reduced(self, slab_axes, naxes, CA_INT64, keep_axis);
|
|
14644
|
+
CArray *co;
|
|
14645
|
+
GetCArray(vout, co);
|
|
14646
|
+
int64_t *op = (int64_t *) co->ptr;
|
|
14647
|
+
ca_iter_state st;
|
|
14648
|
+
int rc = ca_iter_state_init_l2(&st, ca, CA_SLAB_AXES,
|
|
14649
|
+
slab_axes, naxes, 0);
|
|
14650
|
+
if ( rc != CA_ITER_OK ) {
|
|
14651
|
+
rb_raise(rb_eRuntimeError,
|
|
14652
|
+
"count_equal_ki: kernel_iterator init failed rc=%d", rc);
|
|
14653
|
+
}
|
|
14654
|
+
char *p;
|
|
14655
|
+
boolean8_t *m;
|
|
14656
|
+
ca_size_t out_i = 0;
|
|
14657
|
+
boolean8_t *op_mask = NULL; /* lazily allocated on first UNDEF */
|
|
14658
|
+
while ( ca_iter_state_next_slab_axes(&st, &p, &m) ) {
|
|
14659
|
+
int64_t acc;
|
|
14660
|
+
ca_size_t masked_cnt = 0;
|
|
14661
|
+
CA_SLAB_REDUCE_T_EX(VALUE, st, p, m, acc, 0, if (RTEST(rb_equal(v, value_arg))) acc += 1, masked_cnt);
|
|
14662
|
+
if ( (min_count < 0 ? 0 : st.slab_elements - masked_cnt < min_count) ) {
|
|
14663
|
+
if ( ! op_mask ) {
|
|
14664
|
+
ca_create_mask(co);
|
|
14665
|
+
op_mask = (boolean8_t *) co->mask->ptr;
|
|
14666
|
+
}
|
|
14667
|
+
op_mask[out_i] = 1;
|
|
14668
|
+
op[out_i++] = (int64_t) 0; /* sentinel; mask bit is what counts */
|
|
14669
|
+
} else {
|
|
14670
|
+
op[out_i++] = (int64_t) (acc);
|
|
14671
|
+
}
|
|
14672
|
+
}
|
|
14673
|
+
ca_iter_state_finish(&st);
|
|
14674
|
+
if ( naxes == ca->ndim && !keep_axis ) {
|
|
14675
|
+
if ( op_mask && op_mask[0] ) return CA_UNDEF;
|
|
14676
|
+
return LL2NUM(op[0]);
|
|
14677
|
+
}
|
|
14678
|
+
return vout;
|
|
14679
|
+
}
|
|
14680
|
+
|
|
14681
|
+
static VALUE
|
|
14682
|
+
count_equal_ki_native_fixlen (VALUE self, CArray *ca, int8_t *slab_axes, int8_t naxes, int keep_axis, const char *value_arg, ca_size_t min_count)
|
|
14683
|
+
{
|
|
14684
|
+
ca_size_t K = ca->bytes; /* uniform fixlen byte width */
|
|
14685
|
+
VALUE vout = rb_ca_new_reduced(self, slab_axes, naxes, CA_INT64, keep_axis);
|
|
14686
|
+
CArray *co;
|
|
14687
|
+
GetCArray(vout, co);
|
|
14688
|
+
char *op = (char *) co->ptr;
|
|
14689
|
+
ca_iter_state st;
|
|
14690
|
+
int rc = ca_iter_state_init_l2(&st, ca, CA_SLAB_AXES, slab_axes, naxes, 0);
|
|
14691
|
+
if ( rc != CA_ITER_OK ) {
|
|
14692
|
+
rb_raise(rb_eRuntimeError, "count_equal_ki: kernel_iterator init failed rc=%d", rc);
|
|
14693
|
+
}
|
|
14694
|
+
char *p;
|
|
14695
|
+
boolean8_t *m;
|
|
14696
|
+
ca_size_t out_i = 0;
|
|
14697
|
+
boolean8_t *op_mask = NULL; /* lazily allocated on first UNDEF */
|
|
14698
|
+
while ( ca_iter_state_next_slab_axes(&st, &p, &m) ) {
|
|
14699
|
+
int64_t cnt = 0;
|
|
14700
|
+
ca_size_t masked_cnt = 0;
|
|
14701
|
+
int8_t sndim = st.slab_ndim;
|
|
14702
|
+
ca_size_t sidx[CA_RANK_MAX] = { 0 };
|
|
14703
|
+
ca_size_t total = st.slab_elements;
|
|
14704
|
+
for ( ca_size_t idx = 0; idx < total; idx++ ) {
|
|
14705
|
+
ca_size_t doff = 0, moff = 0;
|
|
14706
|
+
for ( int8_t sk = 0; sk < sndim; sk++ ) {
|
|
14707
|
+
doff += sidx[sk] * st.slab_strides[sk];
|
|
14708
|
+
moff += sidx[sk] * st.slab_mask_strides[sk];
|
|
14709
|
+
}
|
|
14710
|
+
if ( m != NULL && m[moff] ) {
|
|
14711
|
+
masked_cnt++;
|
|
14712
|
+
}
|
|
14713
|
+
else {
|
|
14714
|
+
const char *q = (const char *) p + doff;
|
|
14715
|
+
if ( memcmp(q, value_arg, (size_t) K) == 0 ) {
|
|
14716
|
+
cnt++;
|
|
14717
|
+
}
|
|
14718
|
+
}
|
|
14719
|
+
/* row-major odometer (innermost slab axis fastest) so idx
|
|
14720
|
+
matches CA_SLAB_REDUCE_T's flat slab index. */
|
|
14721
|
+
for ( int8_t sk = (int8_t)(sndim - 1); sk >= 0; sk-- ) {
|
|
14722
|
+
if ( ++sidx[sk] < st.slab_dims[sk] ) break;
|
|
14723
|
+
sidx[sk] = 0;
|
|
14724
|
+
}
|
|
14725
|
+
}
|
|
14726
|
+
if ( min_count < 0 ? 0
|
|
14727
|
+
: st.slab_elements - masked_cnt < min_count ) {
|
|
14728
|
+
if ( ! op_mask ) {
|
|
14729
|
+
ca_create_mask(co);
|
|
14730
|
+
op_mask = (boolean8_t *) co->mask->ptr;
|
|
14731
|
+
}
|
|
14732
|
+
op_mask[out_i] = 1;
|
|
14733
|
+
((int64_t *) op)[out_i] = 0; /* sentinel; mask bit is what counts */
|
|
14734
|
+
out_i++;
|
|
14735
|
+
}
|
|
14736
|
+
else {
|
|
14737
|
+
((int64_t *) op)[out_i] = cnt;
|
|
14738
|
+
out_i++;
|
|
14739
|
+
}
|
|
14740
|
+
}
|
|
14741
|
+
ca_iter_state_finish(&st);
|
|
14742
|
+
if ( naxes == ca->ndim && !keep_axis ) {
|
|
14743
|
+
if ( op_mask && op_mask[0] ) return CA_UNDEF;
|
|
14744
|
+
return LL2NUM(((int64_t *) op)[0]);
|
|
14745
|
+
}
|
|
14746
|
+
return vout;
|
|
14747
|
+
}
|
|
14748
|
+
|
|
14491
14749
|
VALUE
|
|
14492
14750
|
rb_ca_count_equal_ki (int argc, VALUE *argv, VALUE self)
|
|
14493
14751
|
{
|
|
@@ -14568,8 +14826,19 @@ rb_ca_count_equal_ki (int argc, VALUE *argv, VALUE self)
|
|
|
14568
14826
|
result = count_equal_ki_native_f64(self, src, slab_axes, naxes, keep_axis, value_arg, min_count);
|
|
14569
14827
|
break;
|
|
14570
14828
|
}
|
|
14829
|
+
case CA_OBJECT: {
|
|
14830
|
+
VALUE value_arg = (VALUE) (VALUE)(rval);
|
|
14831
|
+
result = count_equal_ki_native_object(self, src, slab_axes, naxes, keep_axis, value_arg, min_count);
|
|
14832
|
+
break;
|
|
14833
|
+
}
|
|
14834
|
+
case CA_FIXLEN: {
|
|
14835
|
+
char *value_arg = ALLOCA_N(char, src->bytes);
|
|
14836
|
+
rb_ca_obj2ptr(self, rval, value_arg);
|
|
14837
|
+
result = count_equal_ki_native_fixlen(self, src, slab_axes, naxes, keep_axis, value_arg, min_count);
|
|
14838
|
+
break;
|
|
14839
|
+
}
|
|
14571
14840
|
default:
|
|
14572
|
-
rb_raise(rb_eCADataTypeError, "count_equal_ki: source data_type :%s not supported (expected one of: i8, u8, i16, u16, i32, u32, i64, u64, f32, f64)", ca_type_name[src->data_type]);
|
|
14841
|
+
rb_raise(rb_eCADataTypeError, "count_equal_ki: source data_type :%s not supported (expected one of: i8, u8, i16, u16, i32, u32, i64, u64, f32, f64, object, fixlen)", ca_type_name[src->data_type]);
|
|
14573
14842
|
}
|
|
14574
14843
|
if ( ! NIL_P(rfval) ) {
|
|
14575
14844
|
if ( result == CA_UNDEF ) {
|