carray 3.0.0 → 3.0.1
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/.yardopts +2 -1
- data/CHANGELOG.md +325 -3
- data/{NEWS.md → CHANGELOG.v1.md} +1 -1
- data/README.md +32 -32
- data/carray.gemspec +12 -8
- data/ext/ca_axis_group.c +55 -19
- data/ext/ca_binop_dispatch.c +5 -6
- data/ext/ca_binop_dispatch.h +0 -7
- data/ext/ca_categorical_iterator.c +13 -13
- data/ext/ca_for_each_element.h +6 -8
- data/ext/ca_group_iter.c +1 -1
- data/ext/ca_kernel_iterator.c +69 -23
- data/ext/ca_kernel_iterator.h +3 -10
- data/ext/ca_obj_bincmp.c +57 -27
- data/ext/ca_obj_binop.c +86 -30
- data/ext/ca_obj_const_string.c +3 -1
- data/ext/ca_obj_face.c +80 -0
- data/ext/ca_obj_face.h +33 -1
- data/ext/ca_obj_fake.c +11 -0
- data/ext/ca_obj_fixlen_string.c +3 -1
- data/ext/ca_obj_grid.c +11 -3
- data/ext/ca_obj_meld.c +13 -8
- data/ext/ca_obj_moncmp.c +33 -14
- data/ext/ca_obj_monop.c +19 -7
- data/ext/ca_obj_object.c +99 -4
- data/ext/ca_obj_record.c +3 -1
- data/ext/ca_obj_refer.c +30 -6
- data/ext/ca_obj_roll.c +13 -5
- data/ext/ca_obj_select_axis.c +16 -6
- data/ext/ca_obj_shift.c +3 -3
- data/ext/ca_obj_stride.c +106 -23
- data/ext/ca_obj_string.c +3 -1
- data/ext/ca_obj_tile.c +13 -5
- data/ext/ca_obj_time.c +3 -1
- data/ext/ca_obj_timedelta.c +3 -1
- data/ext/ca_obj_transpose.c +1 -1
- data/ext/ca_obj_triop.c +62 -23
- data/ext/ca_obj_window.c +86 -17
- data/ext/ca_op_cmplx64.h +123 -0
- data/ext/ca_op_ipower.c +0 -3
- data/ext/ca_sort_kernels.h +5 -5
- data/ext/ca_sweep_engine.c +78 -35
- data/ext/ca_sweep_engine.h +13 -4
- data/ext/ca_transform_common.c +7 -0
- data/ext/carray.h +127 -130
- data/ext/carray_access.c +56 -34
- data/ext/carray_bincount.c +8 -8
- data/ext/carray_broadcast.c +99 -6
- data/ext/carray_build_flags.h +3 -0
- data/ext/carray_call_cfunc.c +1491 -0
- data/ext/carray_call_cfunc.h +153 -0
- data/ext/carray_cast.c +69 -31
- data/ext/carray_conversion.c +22 -22
- data/ext/carray_copy.c +12 -2
- data/ext/carray_core.c +57 -10
- data/ext/carray_count.c +1 -1
- data/ext/carray_element.c +7 -7
- data/ext/carray_factorize.c +28 -28
- data/ext/carray_hold.c +1 -1
- data/ext/carray_index_classifier.c +7 -21
- data/ext/carray_internal.h +19 -3
- data/ext/carray_kernels_bincmp.c +1 -0
- data/ext/carray_kernels_binop.c +320 -298
- data/ext/carray_kernels_init.c +1095 -0
- data/ext/carray_kernels_map.c +1 -0
- data/ext/carray_kernels_moncmp.c +1 -0
- data/ext/carray_kernels_monop.c +412 -411
- data/ext/carray_kernels_reduce_aggregate.c +88 -87
- data/ext/carray_kernels_reduce_boolean.c +1 -0
- data/ext/carray_kernels_reduce_cumulative.c +54 -53
- data/ext/carray_kernels_reduce_extreme.c +51 -50
- data/ext/carray_kernels_reduce_variance.c +1 -0
- data/ext/carray_kernels_scan.c +1 -0
- data/ext/carray_kernels_search.c +93 -92
- data/ext/carray_kernels_sort.c +1 -0
- data/ext/carray_kernels_triop.c +1 -0
- data/ext/carray_lazy.c +175 -5
- data/ext/carray_mask.c +6 -5
- data/ext/carray_median_percentile.c +1 -1
- data/ext/carray_memory_view.c +46 -21
- data/ext/carray_operator.c +46 -49
- data/ext/carray_partition.c +4 -4
- data/ext/carray_random.c +7 -7
- data/ext/carray_scatter.c +1 -1
- data/ext/carray_sort.c +3 -3
- data/ext/carray_sort_kernel.c +10 -10
- data/ext/carray_test.c +1 -1
- data/ext/extconf.rb +18 -0
- data/ext/mk_call_cfunc.rb +243 -52
- data/ext/mkkernel.rb +354 -100
- data/ext/ruby_carray.c +18 -16
- data/ext/version.h +4 -4
- data/lib/carray/autoload_carray.rb +19 -0
- data/lib/carray/autoload_method_extension.rb +2 -1
- data/lib/carray/axis_group.rb +7 -7
- data/lib/carray/basics.rb +59 -59
- data/lib/carray/bincount_nd.rb +12 -12
- data/lib/carray/block_iterator.rb +24 -14
- data/lib/carray/categorical.rb +4 -4
- data/lib/carray/categorical_iterator.rb +98 -76
- data/lib/carray/conditional.rb +14 -14
- data/lib/carray/construct.rb +21 -0
- data/lib/carray/core_extensions.rb +62 -5
- data/lib/carray/data_type_extension.rb +18 -1
- data/lib/carray/frame/concat.rb +3 -3
- data/lib/carray/frame/convert.rb +1 -1
- data/lib/carray/frame/frame.rb +4 -11
- data/lib/carray/frame/io.rb +159 -2
- data/lib/carray/frame/sort.rb +1 -1
- data/lib/carray/frame/verbs.rb +18 -1
- data/lib/carray/fuse_source.rb +123 -0
- data/lib/carray/fusion.rb +218 -0
- data/lib/carray/histogram.rb +16 -16
- data/lib/carray/inspect.rb +1 -7
- data/lib/carray/iterator.rb +4 -3
- data/lib/carray/lazy.rb +125 -73
- data/lib/carray/meld_reduce.rb +2 -2
- data/lib/carray/methods/align_addr.rb +1 -1
- data/lib/carray/methods/composition.rb +1 -1
- data/lib/carray/methods/is_in.rb +12 -12
- data/lib/carray/methods/locate_addr.rb +6 -1
- data/lib/carray/methods/mask_duplicates.rb +1 -1
- data/lib/carray/methods/meshgrid.rb +4 -5
- data/lib/carray/methods/mode.rb +2 -2
- data/lib/carray/methods/nunique.rb +1 -1
- data/lib/carray/methods/snap.rb +7 -2
- data/lib/carray/methods/unique.rb +3 -3
- data/lib/carray/methods/value_counts.rb +2 -2
- data/lib/carray/runtime.rb +0 -19
- data/lib/carray/slab_iterator.rb +20 -7
- data/lib/carray/string_operation_extension.rb +5 -5
- data/lib/carray/time.rb +890 -491
- data/lib/carray/window_iterator.rb +285 -13
- data/lib/carray.rb +5 -5
- data/yard-stubs/ca_obj_array.rb +385 -0
- data/yard-stubs/ca_obj_bitarray.rb +38 -0
- data/yard-stubs/ca_obj_bitfield.rb +43 -0
- data/yard-stubs/ca_obj_block.rb +73 -0
- data/yard-stubs/ca_obj_byte_swap.rb +56 -0
- data/yard-stubs/ca_obj_fake.rb +31 -0
- data/yard-stubs/ca_obj_farray.rb +32 -0
- data/yard-stubs/ca_obj_field.rb +45 -0
- data/yard-stubs/ca_obj_grid.rb +35 -0
- data/yard-stubs/ca_obj_refer.rb +72 -0
- data/yard-stubs/ca_obj_roll.rb +45 -0
- data/yard-stubs/ca_obj_shift.rb +43 -0
- data/yard-stubs/ca_obj_stride.rb +181 -0
- data/yard-stubs/ca_obj_tile.rb +29 -0
- data/yard-stubs/ca_obj_transpose.rb +40 -0
- data/yard-stubs/ca_obj_window.rb +49 -0
- data/yard-stubs/carray_access.rb +131 -0
- data/yard-stubs/carray_attribute.rb +246 -0
- data/yard-stubs/carray_broadcast.rb +37 -0
- data/yard-stubs/carray_cast.rb +489 -0
- data/yard-stubs/carray_class.rb +65 -0
- data/yard-stubs/carray_conversion.rb +76 -0
- data/yard-stubs/carray_copy.rb +79 -0
- data/yard-stubs/carray_core.rb +114 -0
- data/yard-stubs/carray_count.rb +79 -0
- data/yard-stubs/carray_element.rb +108 -0
- data/yard-stubs/carray_generate.rb +66 -0
- data/yard-stubs/carray_lazy.rb +23 -0
- data/yard-stubs/carray_loop.rb +140 -0
- data/yard-stubs/carray_mask.rb +259 -0
- data/yard-stubs/carray_math.rb +132 -0
- data/yard-stubs/carray_mathfunc.rb +45 -0
- data/yard-stubs/carray_median_percentile.rb +89 -0
- data/yard-stubs/carray_memory_view.rb +163 -0
- data/yard-stubs/carray_order.rb +312 -0
- data/yard-stubs/carray_random.rb +89 -0
- data/yard-stubs/carray_scatter.rb +106 -0
- data/yard-stubs/carray_slab.rb +57 -0
- data/yard-stubs/carray_sort.rb +163 -0
- data/yard-stubs/carray_test.rb +85 -0
- data/yard-stubs/carray_undef.rb +64 -0
- data/yard-stubs/carray_utils.rb +97 -0
- data/yard-stubs/ruby_carray.rb +193 -0
- metadata +59 -10
- data/ext/ca_obj_unbound_repeat.c +0 -496
data/ext/carray_call_cfunc.c
CHANGED
|
@@ -25,6 +25,18 @@
|
|
|
25
25
|
* operand invariant established in PROPOSAL_EAGER_ELEMENTWISE_NO_ATTACH
|
|
26
26
|
* and extended in PROPOSAL_EAGER_SLOWPATH_CHUNKING_ARENA).
|
|
27
27
|
*
|
|
28
|
+
* Slab variants `ca_call_cslab_N` / `ca_call_cslab_N_r` take the chunked
|
|
29
|
+
* path instead (ca_sweep_acquire_chunked / ca_sweep_next_chunk /
|
|
30
|
+
* ca_sweep_release_chunked) and hand the callback a whole chunk -- base /
|
|
31
|
+
* stride per operand, a cell count, and the chunk's slice of the mask --
|
|
32
|
+
* rather than one cell. A non-alias INPUT is then re-gathered into a
|
|
33
|
+
* ~32KB arena scratch per chunk rather than materialised whole, so input
|
|
34
|
+
* memory peak stops scaling with the operand; and the indirect call is
|
|
35
|
+
* paid once per chunk, so the author's inner loop is one the compiler can
|
|
36
|
+
* vectorise. Use cfunc when the per-cell body is what you have (a math
|
|
37
|
+
* function to wrap); use cslab when the operand is large, virtual, or the
|
|
38
|
+
* body is worth vectorising.
|
|
39
|
+
*
|
|
28
40
|
* L0.1 (PROPOSAL_L0_AUTHOR_SURFACE, 2026-06-11): the per-operand acquire
|
|
29
41
|
* + broadcast check + mask OR + release lifecycle is now factored out
|
|
30
42
|
* into ext/ca_sweep_engine.{c,h} (ca_sweep_acquire / ca_sweep_release). This
|
|
@@ -36,6 +48,16 @@
|
|
|
36
48
|
#include "ca_sweep_engine.h"
|
|
37
49
|
#include <string.h>
|
|
38
50
|
|
|
51
|
+
/* The chunk's iteration mask, or NULL when no INPUT operand carried one.
|
|
52
|
+
m0 is chunk-sized and re-gathered per chunk by ca_sweep_next_chunk, so
|
|
53
|
+
it is already the slice -- one byte per cell, indexed 0..chunk_n-1
|
|
54
|
+
alongside base[] and stride[]. */
|
|
55
|
+
static const boolean8_t *
|
|
56
|
+
ca_sweep_chunk_mask (ca_sweep_state_t *st)
|
|
57
|
+
{
|
|
58
|
+
return st->m0;
|
|
59
|
+
}
|
|
60
|
+
|
|
39
61
|
VALUE
|
|
40
62
|
ca_call_cfunc_1 (void (*func)(void *p0), const char *fsync,
|
|
41
63
|
VALUE rcx0)
|
|
@@ -1635,3 +1657,1472 @@ ca_call_cfunc_3_3_r (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, int8_t
|
|
|
1635
1657
|
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
1636
1658
|
}
|
|
1637
1659
|
|
|
1660
|
+
/* -------------------------------------------------------------------- */
|
|
1661
|
+
/* Slab variants: the chunked counterpart of ca_call_cfunc_N. The */
|
|
1662
|
+
/* callback is handed a whole chunk (base / stride / count / mask */
|
|
1663
|
+
/* slice) rather than one cell, and non-alias INPUTs are gathered */
|
|
1664
|
+
/* into a ~32KB arena scratch per chunk instead of materialised */
|
|
1665
|
+
/* whole, so input memory peak stops scaling with the operand. */
|
|
1666
|
+
/* -------------------------------------------------------------------- */
|
|
1667
|
+
|
|
1668
|
+
VALUE
|
|
1669
|
+
ca_call_cslab_1 (ca_cslab_t func, const char *fsync,
|
|
1670
|
+
VALUE rcx0)
|
|
1671
|
+
{
|
|
1672
|
+
CArray *cx[1];
|
|
1673
|
+
char *base[1];
|
|
1674
|
+
char *base_orig[1];
|
|
1675
|
+
ca_size_t stride[1];
|
|
1676
|
+
char *owned_buf[1];
|
|
1677
|
+
int attached[1];
|
|
1678
|
+
ca_sweep_state_t state;
|
|
1679
|
+
|
|
1680
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1681
|
+
|
|
1682
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1683
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1684
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1685
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1686
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1687
|
+
chunked path walks it, so it has to be given here. */
|
|
1688
|
+
state.n_ops = 1;
|
|
1689
|
+
state.fsync = fsync;
|
|
1690
|
+
state.cx = cx;
|
|
1691
|
+
state.base = base;
|
|
1692
|
+
state.base_orig = base_orig;
|
|
1693
|
+
state.stride = stride;
|
|
1694
|
+
state.owned_buf = owned_buf;
|
|
1695
|
+
state.attached = attached;
|
|
1696
|
+
state.no_mask = 0;
|
|
1697
|
+
state.src_label = "ca_call_cslab_1";
|
|
1698
|
+
|
|
1699
|
+
ca_sweep_acquire_chunked(&state);
|
|
1700
|
+
|
|
1701
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
1702
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
1703
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
1704
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
1705
|
+
sees contiguous data. */
|
|
1706
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
1707
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
ca_sweep_release_chunked(&state);
|
|
1711
|
+
|
|
1712
|
+
return rcx0;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
VALUE
|
|
1716
|
+
ca_call_cslab_2 (ca_cslab_t func, const char *fsync,
|
|
1717
|
+
VALUE rcx0, VALUE rcx1)
|
|
1718
|
+
{
|
|
1719
|
+
CArray *cx[2];
|
|
1720
|
+
char *base[2];
|
|
1721
|
+
char *base_orig[2];
|
|
1722
|
+
ca_size_t stride[2];
|
|
1723
|
+
char *owned_buf[2];
|
|
1724
|
+
int attached[2];
|
|
1725
|
+
ca_sweep_state_t state;
|
|
1726
|
+
|
|
1727
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1728
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
1729
|
+
|
|
1730
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1731
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1732
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1733
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1734
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1735
|
+
chunked path walks it, so it has to be given here. */
|
|
1736
|
+
state.n_ops = 2;
|
|
1737
|
+
state.fsync = fsync;
|
|
1738
|
+
state.cx = cx;
|
|
1739
|
+
state.base = base;
|
|
1740
|
+
state.base_orig = base_orig;
|
|
1741
|
+
state.stride = stride;
|
|
1742
|
+
state.owned_buf = owned_buf;
|
|
1743
|
+
state.attached = attached;
|
|
1744
|
+
state.no_mask = 0;
|
|
1745
|
+
state.src_label = "ca_call_cslab_2";
|
|
1746
|
+
|
|
1747
|
+
ca_sweep_acquire_chunked(&state);
|
|
1748
|
+
|
|
1749
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
1750
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
1751
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
1752
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
1753
|
+
sees contiguous data. */
|
|
1754
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
1755
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
ca_sweep_release_chunked(&state);
|
|
1759
|
+
|
|
1760
|
+
return rcx0;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
VALUE
|
|
1764
|
+
ca_call_cslab_3 (ca_cslab_t func, const char *fsync,
|
|
1765
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2)
|
|
1766
|
+
{
|
|
1767
|
+
CArray *cx[3];
|
|
1768
|
+
char *base[3];
|
|
1769
|
+
char *base_orig[3];
|
|
1770
|
+
ca_size_t stride[3];
|
|
1771
|
+
char *owned_buf[3];
|
|
1772
|
+
int attached[3];
|
|
1773
|
+
ca_sweep_state_t state;
|
|
1774
|
+
|
|
1775
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1776
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
1777
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
1778
|
+
|
|
1779
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1780
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1781
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1782
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1783
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1784
|
+
chunked path walks it, so it has to be given here. */
|
|
1785
|
+
state.n_ops = 3;
|
|
1786
|
+
state.fsync = fsync;
|
|
1787
|
+
state.cx = cx;
|
|
1788
|
+
state.base = base;
|
|
1789
|
+
state.base_orig = base_orig;
|
|
1790
|
+
state.stride = stride;
|
|
1791
|
+
state.owned_buf = owned_buf;
|
|
1792
|
+
state.attached = attached;
|
|
1793
|
+
state.no_mask = 0;
|
|
1794
|
+
state.src_label = "ca_call_cslab_3";
|
|
1795
|
+
|
|
1796
|
+
ca_sweep_acquire_chunked(&state);
|
|
1797
|
+
|
|
1798
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
1799
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
1800
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
1801
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
1802
|
+
sees contiguous data. */
|
|
1803
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
1804
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
ca_sweep_release_chunked(&state);
|
|
1808
|
+
|
|
1809
|
+
return rcx0;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
VALUE
|
|
1813
|
+
ca_call_cslab_4 (ca_cslab_t func, const char *fsync,
|
|
1814
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3)
|
|
1815
|
+
{
|
|
1816
|
+
CArray *cx[4];
|
|
1817
|
+
char *base[4];
|
|
1818
|
+
char *base_orig[4];
|
|
1819
|
+
ca_size_t stride[4];
|
|
1820
|
+
char *owned_buf[4];
|
|
1821
|
+
int attached[4];
|
|
1822
|
+
ca_sweep_state_t state;
|
|
1823
|
+
|
|
1824
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1825
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
1826
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
1827
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
1828
|
+
|
|
1829
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1830
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1831
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1832
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1833
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1834
|
+
chunked path walks it, so it has to be given here. */
|
|
1835
|
+
state.n_ops = 4;
|
|
1836
|
+
state.fsync = fsync;
|
|
1837
|
+
state.cx = cx;
|
|
1838
|
+
state.base = base;
|
|
1839
|
+
state.base_orig = base_orig;
|
|
1840
|
+
state.stride = stride;
|
|
1841
|
+
state.owned_buf = owned_buf;
|
|
1842
|
+
state.attached = attached;
|
|
1843
|
+
state.no_mask = 0;
|
|
1844
|
+
state.src_label = "ca_call_cslab_4";
|
|
1845
|
+
|
|
1846
|
+
ca_sweep_acquire_chunked(&state);
|
|
1847
|
+
|
|
1848
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
1849
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
1850
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
1851
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
1852
|
+
sees contiguous data. */
|
|
1853
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
1854
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
ca_sweep_release_chunked(&state);
|
|
1858
|
+
|
|
1859
|
+
return rcx0;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
VALUE
|
|
1863
|
+
ca_call_cslab_5 (ca_cslab_t func, const char *fsync,
|
|
1864
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3, VALUE rcx4)
|
|
1865
|
+
{
|
|
1866
|
+
CArray *cx[5];
|
|
1867
|
+
char *base[5];
|
|
1868
|
+
char *base_orig[5];
|
|
1869
|
+
ca_size_t stride[5];
|
|
1870
|
+
char *owned_buf[5];
|
|
1871
|
+
int attached[5];
|
|
1872
|
+
ca_sweep_state_t state;
|
|
1873
|
+
|
|
1874
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1875
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
1876
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
1877
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
1878
|
+
TypedData_Get_Struct(rcx4, CArray, &carray_data_type, cx[4]);
|
|
1879
|
+
|
|
1880
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1881
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1882
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1883
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1884
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1885
|
+
chunked path walks it, so it has to be given here. */
|
|
1886
|
+
state.n_ops = 5;
|
|
1887
|
+
state.fsync = fsync;
|
|
1888
|
+
state.cx = cx;
|
|
1889
|
+
state.base = base;
|
|
1890
|
+
state.base_orig = base_orig;
|
|
1891
|
+
state.stride = stride;
|
|
1892
|
+
state.owned_buf = owned_buf;
|
|
1893
|
+
state.attached = attached;
|
|
1894
|
+
state.no_mask = 0;
|
|
1895
|
+
state.src_label = "ca_call_cslab_5";
|
|
1896
|
+
|
|
1897
|
+
ca_sweep_acquire_chunked(&state);
|
|
1898
|
+
|
|
1899
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
1900
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
1901
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
1902
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
1903
|
+
sees contiguous data. */
|
|
1904
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
1905
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
ca_sweep_release_chunked(&state);
|
|
1909
|
+
|
|
1910
|
+
return rcx0;
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
VALUE
|
|
1914
|
+
ca_call_cslab_6 (ca_cslab_t func, const char *fsync,
|
|
1915
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3, VALUE rcx4, VALUE rcx5)
|
|
1916
|
+
{
|
|
1917
|
+
CArray *cx[6];
|
|
1918
|
+
char *base[6];
|
|
1919
|
+
char *base_orig[6];
|
|
1920
|
+
ca_size_t stride[6];
|
|
1921
|
+
char *owned_buf[6];
|
|
1922
|
+
int attached[6];
|
|
1923
|
+
ca_sweep_state_t state;
|
|
1924
|
+
|
|
1925
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1926
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
1927
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
1928
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
1929
|
+
TypedData_Get_Struct(rcx4, CArray, &carray_data_type, cx[4]);
|
|
1930
|
+
TypedData_Get_Struct(rcx5, CArray, &carray_data_type, cx[5]);
|
|
1931
|
+
|
|
1932
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1933
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1934
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1935
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1936
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1937
|
+
chunked path walks it, so it has to be given here. */
|
|
1938
|
+
state.n_ops = 6;
|
|
1939
|
+
state.fsync = fsync;
|
|
1940
|
+
state.cx = cx;
|
|
1941
|
+
state.base = base;
|
|
1942
|
+
state.base_orig = base_orig;
|
|
1943
|
+
state.stride = stride;
|
|
1944
|
+
state.owned_buf = owned_buf;
|
|
1945
|
+
state.attached = attached;
|
|
1946
|
+
state.no_mask = 0;
|
|
1947
|
+
state.src_label = "ca_call_cslab_6";
|
|
1948
|
+
|
|
1949
|
+
ca_sweep_acquire_chunked(&state);
|
|
1950
|
+
|
|
1951
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
1952
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
1953
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
1954
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
1955
|
+
sees contiguous data. */
|
|
1956
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
1957
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
ca_sweep_release_chunked(&state);
|
|
1961
|
+
|
|
1962
|
+
return rcx0;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
VALUE
|
|
1966
|
+
ca_call_cslab_7 (ca_cslab_t func, const char *fsync,
|
|
1967
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3, VALUE rcx4, VALUE rcx5, VALUE rcx6)
|
|
1968
|
+
{
|
|
1969
|
+
CArray *cx[7];
|
|
1970
|
+
char *base[7];
|
|
1971
|
+
char *base_orig[7];
|
|
1972
|
+
ca_size_t stride[7];
|
|
1973
|
+
char *owned_buf[7];
|
|
1974
|
+
int attached[7];
|
|
1975
|
+
ca_sweep_state_t state;
|
|
1976
|
+
|
|
1977
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
1978
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
1979
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
1980
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
1981
|
+
TypedData_Get_Struct(rcx4, CArray, &carray_data_type, cx[4]);
|
|
1982
|
+
TypedData_Get_Struct(rcx5, CArray, &carray_data_type, cx[5]);
|
|
1983
|
+
TypedData_Get_Struct(rcx6, CArray, &carray_data_type, cx[6]);
|
|
1984
|
+
|
|
1985
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
1986
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
1987
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
1988
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
1989
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
1990
|
+
chunked path walks it, so it has to be given here. */
|
|
1991
|
+
state.n_ops = 7;
|
|
1992
|
+
state.fsync = fsync;
|
|
1993
|
+
state.cx = cx;
|
|
1994
|
+
state.base = base;
|
|
1995
|
+
state.base_orig = base_orig;
|
|
1996
|
+
state.stride = stride;
|
|
1997
|
+
state.owned_buf = owned_buf;
|
|
1998
|
+
state.attached = attached;
|
|
1999
|
+
state.no_mask = 0;
|
|
2000
|
+
state.src_label = "ca_call_cslab_7";
|
|
2001
|
+
|
|
2002
|
+
ca_sweep_acquire_chunked(&state);
|
|
2003
|
+
|
|
2004
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2005
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2006
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2007
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2008
|
+
sees contiguous data. */
|
|
2009
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2010
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state));
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
ca_sweep_release_chunked(&state);
|
|
2014
|
+
|
|
2015
|
+
return rcx0;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
VALUE
|
|
2019
|
+
ca_call_cslab_1_r (ca_cslab_r_t func, const char *fsync,
|
|
2020
|
+
VALUE rcx0,
|
|
2021
|
+
void *userdata)
|
|
2022
|
+
{
|
|
2023
|
+
CArray *cx[1];
|
|
2024
|
+
char *base[1];
|
|
2025
|
+
char *base_orig[1];
|
|
2026
|
+
ca_size_t stride[1];
|
|
2027
|
+
char *owned_buf[1];
|
|
2028
|
+
int attached[1];
|
|
2029
|
+
ca_sweep_state_t state;
|
|
2030
|
+
|
|
2031
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2032
|
+
|
|
2033
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2034
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2035
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2036
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2037
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2038
|
+
chunked path walks it, so it has to be given here. */
|
|
2039
|
+
state.n_ops = 1;
|
|
2040
|
+
state.fsync = fsync;
|
|
2041
|
+
state.cx = cx;
|
|
2042
|
+
state.base = base;
|
|
2043
|
+
state.base_orig = base_orig;
|
|
2044
|
+
state.stride = stride;
|
|
2045
|
+
state.owned_buf = owned_buf;
|
|
2046
|
+
state.attached = attached;
|
|
2047
|
+
state.no_mask = 0;
|
|
2048
|
+
state.src_label = "ca_call_cslab_1_r";
|
|
2049
|
+
|
|
2050
|
+
ca_sweep_acquire_chunked(&state);
|
|
2051
|
+
|
|
2052
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2053
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2054
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2055
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2056
|
+
sees contiguous data. */
|
|
2057
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2058
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
ca_sweep_release_chunked(&state);
|
|
2062
|
+
|
|
2063
|
+
return rcx0;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
VALUE
|
|
2067
|
+
ca_call_cslab_2_r (ca_cslab_r_t func, const char *fsync,
|
|
2068
|
+
VALUE rcx0, VALUE rcx1,
|
|
2069
|
+
void *userdata)
|
|
2070
|
+
{
|
|
2071
|
+
CArray *cx[2];
|
|
2072
|
+
char *base[2];
|
|
2073
|
+
char *base_orig[2];
|
|
2074
|
+
ca_size_t stride[2];
|
|
2075
|
+
char *owned_buf[2];
|
|
2076
|
+
int attached[2];
|
|
2077
|
+
ca_sweep_state_t state;
|
|
2078
|
+
|
|
2079
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2080
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
2081
|
+
|
|
2082
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2083
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2084
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2085
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2086
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2087
|
+
chunked path walks it, so it has to be given here. */
|
|
2088
|
+
state.n_ops = 2;
|
|
2089
|
+
state.fsync = fsync;
|
|
2090
|
+
state.cx = cx;
|
|
2091
|
+
state.base = base;
|
|
2092
|
+
state.base_orig = base_orig;
|
|
2093
|
+
state.stride = stride;
|
|
2094
|
+
state.owned_buf = owned_buf;
|
|
2095
|
+
state.attached = attached;
|
|
2096
|
+
state.no_mask = 0;
|
|
2097
|
+
state.src_label = "ca_call_cslab_2_r";
|
|
2098
|
+
|
|
2099
|
+
ca_sweep_acquire_chunked(&state);
|
|
2100
|
+
|
|
2101
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2102
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2103
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2104
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2105
|
+
sees contiguous data. */
|
|
2106
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2107
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
ca_sweep_release_chunked(&state);
|
|
2111
|
+
|
|
2112
|
+
return rcx0;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
VALUE
|
|
2116
|
+
ca_call_cslab_3_r (ca_cslab_r_t func, const char *fsync,
|
|
2117
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2,
|
|
2118
|
+
void *userdata)
|
|
2119
|
+
{
|
|
2120
|
+
CArray *cx[3];
|
|
2121
|
+
char *base[3];
|
|
2122
|
+
char *base_orig[3];
|
|
2123
|
+
ca_size_t stride[3];
|
|
2124
|
+
char *owned_buf[3];
|
|
2125
|
+
int attached[3];
|
|
2126
|
+
ca_sweep_state_t state;
|
|
2127
|
+
|
|
2128
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2129
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
2130
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
2131
|
+
|
|
2132
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2133
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2134
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2135
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2136
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2137
|
+
chunked path walks it, so it has to be given here. */
|
|
2138
|
+
state.n_ops = 3;
|
|
2139
|
+
state.fsync = fsync;
|
|
2140
|
+
state.cx = cx;
|
|
2141
|
+
state.base = base;
|
|
2142
|
+
state.base_orig = base_orig;
|
|
2143
|
+
state.stride = stride;
|
|
2144
|
+
state.owned_buf = owned_buf;
|
|
2145
|
+
state.attached = attached;
|
|
2146
|
+
state.no_mask = 0;
|
|
2147
|
+
state.src_label = "ca_call_cslab_3_r";
|
|
2148
|
+
|
|
2149
|
+
ca_sweep_acquire_chunked(&state);
|
|
2150
|
+
|
|
2151
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2152
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2153
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2154
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2155
|
+
sees contiguous data. */
|
|
2156
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2157
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
ca_sweep_release_chunked(&state);
|
|
2161
|
+
|
|
2162
|
+
return rcx0;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
VALUE
|
|
2166
|
+
ca_call_cslab_4_r (ca_cslab_r_t func, const char *fsync,
|
|
2167
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3,
|
|
2168
|
+
void *userdata)
|
|
2169
|
+
{
|
|
2170
|
+
CArray *cx[4];
|
|
2171
|
+
char *base[4];
|
|
2172
|
+
char *base_orig[4];
|
|
2173
|
+
ca_size_t stride[4];
|
|
2174
|
+
char *owned_buf[4];
|
|
2175
|
+
int attached[4];
|
|
2176
|
+
ca_sweep_state_t state;
|
|
2177
|
+
|
|
2178
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2179
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
2180
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
2181
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
2182
|
+
|
|
2183
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2184
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2185
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2186
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2187
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2188
|
+
chunked path walks it, so it has to be given here. */
|
|
2189
|
+
state.n_ops = 4;
|
|
2190
|
+
state.fsync = fsync;
|
|
2191
|
+
state.cx = cx;
|
|
2192
|
+
state.base = base;
|
|
2193
|
+
state.base_orig = base_orig;
|
|
2194
|
+
state.stride = stride;
|
|
2195
|
+
state.owned_buf = owned_buf;
|
|
2196
|
+
state.attached = attached;
|
|
2197
|
+
state.no_mask = 0;
|
|
2198
|
+
state.src_label = "ca_call_cslab_4_r";
|
|
2199
|
+
|
|
2200
|
+
ca_sweep_acquire_chunked(&state);
|
|
2201
|
+
|
|
2202
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2203
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2204
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2205
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2206
|
+
sees contiguous data. */
|
|
2207
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2208
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
ca_sweep_release_chunked(&state);
|
|
2212
|
+
|
|
2213
|
+
return rcx0;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
VALUE
|
|
2217
|
+
ca_call_cslab_5_r (ca_cslab_r_t func, const char *fsync,
|
|
2218
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3, VALUE rcx4,
|
|
2219
|
+
void *userdata)
|
|
2220
|
+
{
|
|
2221
|
+
CArray *cx[5];
|
|
2222
|
+
char *base[5];
|
|
2223
|
+
char *base_orig[5];
|
|
2224
|
+
ca_size_t stride[5];
|
|
2225
|
+
char *owned_buf[5];
|
|
2226
|
+
int attached[5];
|
|
2227
|
+
ca_sweep_state_t state;
|
|
2228
|
+
|
|
2229
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2230
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
2231
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
2232
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
2233
|
+
TypedData_Get_Struct(rcx4, CArray, &carray_data_type, cx[4]);
|
|
2234
|
+
|
|
2235
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2236
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2237
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2238
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2239
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2240
|
+
chunked path walks it, so it has to be given here. */
|
|
2241
|
+
state.n_ops = 5;
|
|
2242
|
+
state.fsync = fsync;
|
|
2243
|
+
state.cx = cx;
|
|
2244
|
+
state.base = base;
|
|
2245
|
+
state.base_orig = base_orig;
|
|
2246
|
+
state.stride = stride;
|
|
2247
|
+
state.owned_buf = owned_buf;
|
|
2248
|
+
state.attached = attached;
|
|
2249
|
+
state.no_mask = 0;
|
|
2250
|
+
state.src_label = "ca_call_cslab_5_r";
|
|
2251
|
+
|
|
2252
|
+
ca_sweep_acquire_chunked(&state);
|
|
2253
|
+
|
|
2254
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2255
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2256
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2257
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2258
|
+
sees contiguous data. */
|
|
2259
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2260
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
ca_sweep_release_chunked(&state);
|
|
2264
|
+
|
|
2265
|
+
return rcx0;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
VALUE
|
|
2269
|
+
ca_call_cslab_6_r (ca_cslab_r_t func, const char *fsync,
|
|
2270
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3, VALUE rcx4, VALUE rcx5,
|
|
2271
|
+
void *userdata)
|
|
2272
|
+
{
|
|
2273
|
+
CArray *cx[6];
|
|
2274
|
+
char *base[6];
|
|
2275
|
+
char *base_orig[6];
|
|
2276
|
+
ca_size_t stride[6];
|
|
2277
|
+
char *owned_buf[6];
|
|
2278
|
+
int attached[6];
|
|
2279
|
+
ca_sweep_state_t state;
|
|
2280
|
+
|
|
2281
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2282
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
2283
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
2284
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
2285
|
+
TypedData_Get_Struct(rcx4, CArray, &carray_data_type, cx[4]);
|
|
2286
|
+
TypedData_Get_Struct(rcx5, CArray, &carray_data_type, cx[5]);
|
|
2287
|
+
|
|
2288
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2289
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2290
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2291
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2292
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2293
|
+
chunked path walks it, so it has to be given here. */
|
|
2294
|
+
state.n_ops = 6;
|
|
2295
|
+
state.fsync = fsync;
|
|
2296
|
+
state.cx = cx;
|
|
2297
|
+
state.base = base;
|
|
2298
|
+
state.base_orig = base_orig;
|
|
2299
|
+
state.stride = stride;
|
|
2300
|
+
state.owned_buf = owned_buf;
|
|
2301
|
+
state.attached = attached;
|
|
2302
|
+
state.no_mask = 0;
|
|
2303
|
+
state.src_label = "ca_call_cslab_6_r";
|
|
2304
|
+
|
|
2305
|
+
ca_sweep_acquire_chunked(&state);
|
|
2306
|
+
|
|
2307
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2308
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2309
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2310
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2311
|
+
sees contiguous data. */
|
|
2312
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2313
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
ca_sweep_release_chunked(&state);
|
|
2317
|
+
|
|
2318
|
+
return rcx0;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
VALUE
|
|
2322
|
+
ca_call_cslab_7_r (ca_cslab_r_t func, const char *fsync,
|
|
2323
|
+
VALUE rcx0, VALUE rcx1, VALUE rcx2, VALUE rcx3, VALUE rcx4, VALUE rcx5, VALUE rcx6,
|
|
2324
|
+
void *userdata)
|
|
2325
|
+
{
|
|
2326
|
+
CArray *cx[7];
|
|
2327
|
+
char *base[7];
|
|
2328
|
+
char *base_orig[7];
|
|
2329
|
+
ca_size_t stride[7];
|
|
2330
|
+
char *owned_buf[7];
|
|
2331
|
+
int attached[7];
|
|
2332
|
+
ca_sweep_state_t state;
|
|
2333
|
+
|
|
2334
|
+
TypedData_Get_Struct(rcx0, CArray, &carray_data_type, cx[0]);
|
|
2335
|
+
TypedData_Get_Struct(rcx1, CArray, &carray_data_type, cx[1]);
|
|
2336
|
+
TypedData_Get_Struct(rcx2, CArray, &carray_data_type, cx[2]);
|
|
2337
|
+
TypedData_Get_Struct(rcx3, CArray, &carray_data_type, cx[3]);
|
|
2338
|
+
TypedData_Get_Struct(rcx4, CArray, &carray_data_type, cx[4]);
|
|
2339
|
+
TypedData_Get_Struct(rcx5, CArray, &carray_data_type, cx[5]);
|
|
2340
|
+
TypedData_Get_Struct(rcx6, CArray, &carray_data_type, cx[6]);
|
|
2341
|
+
|
|
2342
|
+
/* sweep engine, chunked path: per-operand acquire (attach for OUTPUT
|
|
2343
|
+
and alias INPUT, arena chunk scratch for non-alias INPUT), broadcast
|
|
2344
|
+
shape check, mask OR across INPUTs, mask propagate to OUTPUTs at
|
|
2345
|
+
release. Lifecycle template lives in ext/ca_sweep_engine.{c,h}.
|
|
2346
|
+
base_orig is the field the whole-buffer path leaves zero; the
|
|
2347
|
+
chunked path walks it, so it has to be given here. */
|
|
2348
|
+
state.n_ops = 7;
|
|
2349
|
+
state.fsync = fsync;
|
|
2350
|
+
state.cx = cx;
|
|
2351
|
+
state.base = base;
|
|
2352
|
+
state.base_orig = base_orig;
|
|
2353
|
+
state.stride = stride;
|
|
2354
|
+
state.owned_buf = owned_buf;
|
|
2355
|
+
state.attached = attached;
|
|
2356
|
+
state.no_mask = 0;
|
|
2357
|
+
state.src_label = "ca_call_cslab_7_r";
|
|
2358
|
+
|
|
2359
|
+
ca_sweep_acquire_chunked(&state);
|
|
2360
|
+
|
|
2361
|
+
/* outer loop: hand the author one chunk at a time. base[] is rewritten
|
|
2362
|
+
per chunk by ca_sweep_next_chunk -- for a non-alias INPUT it points
|
|
2363
|
+
at the arena scratch the chunk was just gathered into, which is
|
|
2364
|
+
packed, so stride[] is the element size and the author's inner loop
|
|
2365
|
+
sees contiguous data. */
|
|
2366
|
+
while ( ca_sweep_next_chunk(&state) ) {
|
|
2367
|
+
func(base, stride, state.chunk_n, ca_sweep_chunk_mask(&state), userdata);
|
|
2368
|
+
}
|
|
2369
|
+
|
|
2370
|
+
ca_sweep_release_chunked(&state);
|
|
2371
|
+
|
|
2372
|
+
return rcx0;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
VALUE
|
|
2376
|
+
ca_call_cslab_1_1 (int8_t dty, int8_t dtx1, ca_cslab_t slabfunc, volatile VALUE rx1)
|
|
2377
|
+
{
|
|
2378
|
+
volatile VALUE ry = Qnil;
|
|
2379
|
+
|
|
2380
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2381
|
+
|
|
2382
|
+
if ( dty != dtx1 ) {
|
|
2383
|
+
ry = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty)));
|
|
2384
|
+
} else {
|
|
2385
|
+
ry = rb_ca_template_n(1, rx1);
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
ca_call_cslab_2(slabfunc, "10", ry, rx1);
|
|
2389
|
+
|
|
2390
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2391
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2392
|
+
}
|
|
2393
|
+
return ry;
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
VALUE
|
|
2397
|
+
ca_call_cslab_1_2 (int8_t dty, int8_t dtx1, int8_t dtx2, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2)
|
|
2398
|
+
{
|
|
2399
|
+
volatile VALUE ry = Qnil;
|
|
2400
|
+
|
|
2401
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2402
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2403
|
+
|
|
2404
|
+
if ( dty != dtx1 || dty != dtx2 ) {
|
|
2405
|
+
ry = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)));
|
|
2406
|
+
} else {
|
|
2407
|
+
ry = rb_ca_template_n(2, rx1, rx2);
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
ca_call_cslab_3(slabfunc, "100", ry, rx1, rx2);
|
|
2411
|
+
|
|
2412
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2413
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2414
|
+
}
|
|
2415
|
+
return ry;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
VALUE
|
|
2419
|
+
ca_call_cslab_1_3 (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3)
|
|
2420
|
+
{
|
|
2421
|
+
volatile VALUE ry = Qnil;
|
|
2422
|
+
|
|
2423
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2424
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2425
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2426
|
+
|
|
2427
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 ) {
|
|
2428
|
+
ry = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)));
|
|
2429
|
+
} else {
|
|
2430
|
+
ry = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
ca_call_cslab_4(slabfunc, "1000", ry, rx1, rx2, rx3);
|
|
2434
|
+
|
|
2435
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2436
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2437
|
+
}
|
|
2438
|
+
return ry;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
VALUE
|
|
2442
|
+
ca_call_cslab_1_4 (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4)
|
|
2443
|
+
{
|
|
2444
|
+
volatile VALUE ry = Qnil;
|
|
2445
|
+
|
|
2446
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2447
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2448
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2449
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2450
|
+
|
|
2451
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 || dty != dtx4 ) {
|
|
2452
|
+
ry = rb_ca_template_n(4, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)), rb_ca_wrap_readonly(rx4, INT2NUM(dty)));
|
|
2453
|
+
} else {
|
|
2454
|
+
ry = rb_ca_template_n(4, rx1, rx2, rx3, rx4);
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
ca_call_cslab_5(slabfunc, "10000", ry, rx1, rx2, rx3, rx4);
|
|
2458
|
+
|
|
2459
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2460
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2461
|
+
}
|
|
2462
|
+
return ry;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
VALUE
|
|
2466
|
+
ca_call_cslab_1_5 (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, int8_t dtx5, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4, volatile VALUE rx5)
|
|
2467
|
+
{
|
|
2468
|
+
volatile VALUE ry = Qnil;
|
|
2469
|
+
|
|
2470
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2471
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2472
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2473
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2474
|
+
rx5 = rb_ca_wrap_readonly(rx5, INT2NUM(dtx5));
|
|
2475
|
+
|
|
2476
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 || dty != dtx4 || dty != dtx5 ) {
|
|
2477
|
+
ry = rb_ca_template_n(5, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)), rb_ca_wrap_readonly(rx4, INT2NUM(dty)), rb_ca_wrap_readonly(rx5, INT2NUM(dty)));
|
|
2478
|
+
} else {
|
|
2479
|
+
ry = rb_ca_template_n(5, rx1, rx2, rx3, rx4, rx5);
|
|
2480
|
+
}
|
|
2481
|
+
|
|
2482
|
+
ca_call_cslab_6(slabfunc, "100000", ry, rx1, rx2, rx3, rx4, rx5);
|
|
2483
|
+
|
|
2484
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2485
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2486
|
+
}
|
|
2487
|
+
return ry;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
VALUE
|
|
2491
|
+
ca_call_cslab_1_6 (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, int8_t dtx5, int8_t dtx6, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4, volatile VALUE rx5, volatile VALUE rx6)
|
|
2492
|
+
{
|
|
2493
|
+
volatile VALUE ry = Qnil;
|
|
2494
|
+
|
|
2495
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2496
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2497
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2498
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2499
|
+
rx5 = rb_ca_wrap_readonly(rx5, INT2NUM(dtx5));
|
|
2500
|
+
rx6 = rb_ca_wrap_readonly(rx6, INT2NUM(dtx6));
|
|
2501
|
+
|
|
2502
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 || dty != dtx4 || dty != dtx5 || dty != dtx6 ) {
|
|
2503
|
+
ry = rb_ca_template_n(6, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)), rb_ca_wrap_readonly(rx4, INT2NUM(dty)), rb_ca_wrap_readonly(rx5, INT2NUM(dty)), rb_ca_wrap_readonly(rx6, INT2NUM(dty)));
|
|
2504
|
+
} else {
|
|
2505
|
+
ry = rb_ca_template_n(6, rx1, rx2, rx3, rx4, rx5, rx6);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
ca_call_cslab_7(slabfunc, "1000000", ry, rx1, rx2, rx3, rx4, rx5, rx6);
|
|
2509
|
+
|
|
2510
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2511
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2512
|
+
}
|
|
2513
|
+
return ry;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
VALUE
|
|
2517
|
+
ca_call_cslab_2_1 (int8_t dty1, int8_t dty2, int8_t dtx1, ca_cslab_t slabfunc, volatile VALUE rx1)
|
|
2518
|
+
{
|
|
2519
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2520
|
+
|
|
2521
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2522
|
+
|
|
2523
|
+
if ( dty1 != dtx1 ) {
|
|
2524
|
+
ry1 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)));
|
|
2525
|
+
} else {
|
|
2526
|
+
ry1 = rb_ca_template_n(1, rx1);
|
|
2527
|
+
}
|
|
2528
|
+
if ( dty2 != dtx1 ) {
|
|
2529
|
+
ry2 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)));
|
|
2530
|
+
} else {
|
|
2531
|
+
ry2 = rb_ca_template_n(1, rx1);
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
ca_call_cslab_3(slabfunc, "110", ry1, ry2, rx1);
|
|
2535
|
+
|
|
2536
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2537
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2538
|
+
}
|
|
2539
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2540
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2541
|
+
}
|
|
2542
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
VALUE
|
|
2546
|
+
ca_call_cslab_2_2 (int8_t dty1, int8_t dty2, int8_t dtx1, int8_t dtx2, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2)
|
|
2547
|
+
{
|
|
2548
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2549
|
+
|
|
2550
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2551
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2552
|
+
|
|
2553
|
+
if ( dty1 != dtx1 || dty1 != dtx2 ) {
|
|
2554
|
+
ry1 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)));
|
|
2555
|
+
} else {
|
|
2556
|
+
ry1 = rb_ca_template_n(2, rx1, rx2);
|
|
2557
|
+
}
|
|
2558
|
+
if ( dty2 != dtx1 || dty2 != dtx2 ) {
|
|
2559
|
+
ry2 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)));
|
|
2560
|
+
} else {
|
|
2561
|
+
ry2 = rb_ca_template_n(2, rx1, rx2);
|
|
2562
|
+
}
|
|
2563
|
+
|
|
2564
|
+
ca_call_cslab_4(slabfunc, "1100", ry1, ry2, rx1, rx2);
|
|
2565
|
+
|
|
2566
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2567
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2568
|
+
}
|
|
2569
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2570
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2571
|
+
}
|
|
2572
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
VALUE
|
|
2576
|
+
ca_call_cslab_2_3 (int8_t dty1, int8_t dty2, int8_t dtx1, int8_t dtx2, int8_t dtx3, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3)
|
|
2577
|
+
{
|
|
2578
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2579
|
+
|
|
2580
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2581
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2582
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2583
|
+
|
|
2584
|
+
if ( dty1 != dtx1 || dty1 != dtx2 || dty1 != dtx3 ) {
|
|
2585
|
+
ry1 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)), rb_ca_wrap_readonly(rx3, INT2NUM(dty1)));
|
|
2586
|
+
} else {
|
|
2587
|
+
ry1 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2588
|
+
}
|
|
2589
|
+
if ( dty2 != dtx1 || dty2 != dtx2 || dty2 != dtx3 ) {
|
|
2590
|
+
ry2 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)), rb_ca_wrap_readonly(rx3, INT2NUM(dty2)));
|
|
2591
|
+
} else {
|
|
2592
|
+
ry2 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
ca_call_cslab_5(slabfunc, "11000", ry1, ry2, rx1, rx2, rx3);
|
|
2596
|
+
|
|
2597
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2598
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2599
|
+
}
|
|
2600
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2601
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2602
|
+
}
|
|
2603
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
VALUE
|
|
2607
|
+
ca_call_cslab_2_4 (int8_t dty1, int8_t dty2, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4)
|
|
2608
|
+
{
|
|
2609
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2610
|
+
|
|
2611
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2612
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2613
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2614
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2615
|
+
|
|
2616
|
+
if ( dty1 != dtx1 || dty1 != dtx2 || dty1 != dtx3 || dty1 != dtx4 ) {
|
|
2617
|
+
ry1 = rb_ca_template_n(4, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)), rb_ca_wrap_readonly(rx3, INT2NUM(dty1)), rb_ca_wrap_readonly(rx4, INT2NUM(dty1)));
|
|
2618
|
+
} else {
|
|
2619
|
+
ry1 = rb_ca_template_n(4, rx1, rx2, rx3, rx4);
|
|
2620
|
+
}
|
|
2621
|
+
if ( dty2 != dtx1 || dty2 != dtx2 || dty2 != dtx3 || dty2 != dtx4 ) {
|
|
2622
|
+
ry2 = rb_ca_template_n(4, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)), rb_ca_wrap_readonly(rx3, INT2NUM(dty2)), rb_ca_wrap_readonly(rx4, INT2NUM(dty2)));
|
|
2623
|
+
} else {
|
|
2624
|
+
ry2 = rb_ca_template_n(4, rx1, rx2, rx3, rx4);
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
ca_call_cslab_6(slabfunc, "110000", ry1, ry2, rx1, rx2, rx3, rx4);
|
|
2628
|
+
|
|
2629
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2630
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2631
|
+
}
|
|
2632
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2633
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2634
|
+
}
|
|
2635
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
VALUE
|
|
2639
|
+
ca_call_cslab_3_1 (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, ca_cslab_t slabfunc, volatile VALUE rx1)
|
|
2640
|
+
{
|
|
2641
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil, ry3 = Qnil;
|
|
2642
|
+
|
|
2643
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2644
|
+
|
|
2645
|
+
if ( dty1 != dtx1 ) {
|
|
2646
|
+
ry1 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)));
|
|
2647
|
+
} else {
|
|
2648
|
+
ry1 = rb_ca_template_n(1, rx1);
|
|
2649
|
+
}
|
|
2650
|
+
if ( dty2 != dtx1 ) {
|
|
2651
|
+
ry2 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)));
|
|
2652
|
+
} else {
|
|
2653
|
+
ry2 = rb_ca_template_n(1, rx1);
|
|
2654
|
+
}
|
|
2655
|
+
if ( dty3 != dtx1 ) {
|
|
2656
|
+
ry3 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty3)));
|
|
2657
|
+
} else {
|
|
2658
|
+
ry3 = rb_ca_template_n(1, rx1);
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
ca_call_cslab_4(slabfunc, "1110", ry1, ry2, ry3, rx1);
|
|
2662
|
+
|
|
2663
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2664
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2665
|
+
}
|
|
2666
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2667
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2668
|
+
}
|
|
2669
|
+
if ( rb_ca_is_scalar(ry3) ) {
|
|
2670
|
+
ry3 = rb_ca_fetch_addr(ry3, 0);
|
|
2671
|
+
}
|
|
2672
|
+
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
VALUE
|
|
2676
|
+
ca_call_cslab_3_2 (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, int8_t dtx2, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2)
|
|
2677
|
+
{
|
|
2678
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil, ry3 = Qnil;
|
|
2679
|
+
|
|
2680
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2681
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2682
|
+
|
|
2683
|
+
if ( dty1 != dtx1 || dty1 != dtx2 ) {
|
|
2684
|
+
ry1 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)));
|
|
2685
|
+
} else {
|
|
2686
|
+
ry1 = rb_ca_template_n(2, rx1, rx2);
|
|
2687
|
+
}
|
|
2688
|
+
if ( dty2 != dtx1 || dty2 != dtx2 ) {
|
|
2689
|
+
ry2 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)));
|
|
2690
|
+
} else {
|
|
2691
|
+
ry2 = rb_ca_template_n(2, rx1, rx2);
|
|
2692
|
+
}
|
|
2693
|
+
if ( dty3 != dtx1 || dty3 != dtx2 ) {
|
|
2694
|
+
ry3 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty3)), rb_ca_wrap_readonly(rx2, INT2NUM(dty3)));
|
|
2695
|
+
} else {
|
|
2696
|
+
ry3 = rb_ca_template_n(2, rx1, rx2);
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
ca_call_cslab_5(slabfunc, "11100", ry1, ry2, ry3, rx1, rx2);
|
|
2700
|
+
|
|
2701
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2702
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2703
|
+
}
|
|
2704
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2705
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2706
|
+
}
|
|
2707
|
+
if ( rb_ca_is_scalar(ry3) ) {
|
|
2708
|
+
ry3 = rb_ca_fetch_addr(ry3, 0);
|
|
2709
|
+
}
|
|
2710
|
+
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
VALUE
|
|
2714
|
+
ca_call_cslab_3_3 (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, int8_t dtx2, int8_t dtx3, ca_cslab_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3)
|
|
2715
|
+
{
|
|
2716
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil, ry3 = Qnil;
|
|
2717
|
+
|
|
2718
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2719
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2720
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2721
|
+
|
|
2722
|
+
if ( dty1 != dtx1 || dty1 != dtx2 || dty1 != dtx3 ) {
|
|
2723
|
+
ry1 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)), rb_ca_wrap_readonly(rx3, INT2NUM(dty1)));
|
|
2724
|
+
} else {
|
|
2725
|
+
ry1 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2726
|
+
}
|
|
2727
|
+
if ( dty2 != dtx1 || dty2 != dtx2 || dty2 != dtx3 ) {
|
|
2728
|
+
ry2 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)), rb_ca_wrap_readonly(rx3, INT2NUM(dty2)));
|
|
2729
|
+
} else {
|
|
2730
|
+
ry2 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2731
|
+
}
|
|
2732
|
+
if ( dty3 != dtx1 || dty3 != dtx2 || dty3 != dtx3 ) {
|
|
2733
|
+
ry3 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty3)), rb_ca_wrap_readonly(rx2, INT2NUM(dty3)), rb_ca_wrap_readonly(rx3, INT2NUM(dty3)));
|
|
2734
|
+
} else {
|
|
2735
|
+
ry3 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
ca_call_cslab_6(slabfunc, "111000", ry1, ry2, ry3, rx1, rx2, rx3);
|
|
2739
|
+
|
|
2740
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2741
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2742
|
+
}
|
|
2743
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2744
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2745
|
+
}
|
|
2746
|
+
if ( rb_ca_is_scalar(ry3) ) {
|
|
2747
|
+
ry3 = rb_ca_fetch_addr(ry3, 0);
|
|
2748
|
+
}
|
|
2749
|
+
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
VALUE
|
|
2753
|
+
ca_call_cslab_1_1_r (int8_t dty, int8_t dtx1, ca_cslab_r_t slabfunc, volatile VALUE rx1, void *userdata)
|
|
2754
|
+
{
|
|
2755
|
+
volatile VALUE ry = Qnil;
|
|
2756
|
+
|
|
2757
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2758
|
+
|
|
2759
|
+
if ( dty != dtx1 ) {
|
|
2760
|
+
ry = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty)));
|
|
2761
|
+
} else {
|
|
2762
|
+
ry = rb_ca_template_n(1, rx1);
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2765
|
+
ca_call_cslab_2_r(slabfunc, "10", ry, rx1, userdata);
|
|
2766
|
+
|
|
2767
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2768
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2769
|
+
}
|
|
2770
|
+
return ry;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
VALUE
|
|
2774
|
+
ca_call_cslab_1_2_r (int8_t dty, int8_t dtx1, int8_t dtx2, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, void *userdata)
|
|
2775
|
+
{
|
|
2776
|
+
volatile VALUE ry = Qnil;
|
|
2777
|
+
|
|
2778
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2779
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2780
|
+
|
|
2781
|
+
if ( dty != dtx1 || dty != dtx2 ) {
|
|
2782
|
+
ry = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)));
|
|
2783
|
+
} else {
|
|
2784
|
+
ry = rb_ca_template_n(2, rx1, rx2);
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
ca_call_cslab_3_r(slabfunc, "100", ry, rx1, rx2, userdata);
|
|
2788
|
+
|
|
2789
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2790
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2791
|
+
}
|
|
2792
|
+
return ry;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
VALUE
|
|
2796
|
+
ca_call_cslab_1_3_r (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, void *userdata)
|
|
2797
|
+
{
|
|
2798
|
+
volatile VALUE ry = Qnil;
|
|
2799
|
+
|
|
2800
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2801
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2802
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2803
|
+
|
|
2804
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 ) {
|
|
2805
|
+
ry = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)));
|
|
2806
|
+
} else {
|
|
2807
|
+
ry = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
ca_call_cslab_4_r(slabfunc, "1000", ry, rx1, rx2, rx3, userdata);
|
|
2811
|
+
|
|
2812
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2813
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2814
|
+
}
|
|
2815
|
+
return ry;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
VALUE
|
|
2819
|
+
ca_call_cslab_1_4_r (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4, void *userdata)
|
|
2820
|
+
{
|
|
2821
|
+
volatile VALUE ry = Qnil;
|
|
2822
|
+
|
|
2823
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2824
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2825
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2826
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2827
|
+
|
|
2828
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 || dty != dtx4 ) {
|
|
2829
|
+
ry = rb_ca_template_n(4, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)), rb_ca_wrap_readonly(rx4, INT2NUM(dty)));
|
|
2830
|
+
} else {
|
|
2831
|
+
ry = rb_ca_template_n(4, rx1, rx2, rx3, rx4);
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
ca_call_cslab_5_r(slabfunc, "10000", ry, rx1, rx2, rx3, rx4, userdata);
|
|
2835
|
+
|
|
2836
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2837
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2838
|
+
}
|
|
2839
|
+
return ry;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
VALUE
|
|
2843
|
+
ca_call_cslab_1_5_r (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, int8_t dtx5, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4, volatile VALUE rx5, void *userdata)
|
|
2844
|
+
{
|
|
2845
|
+
volatile VALUE ry = Qnil;
|
|
2846
|
+
|
|
2847
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2848
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2849
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2850
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2851
|
+
rx5 = rb_ca_wrap_readonly(rx5, INT2NUM(dtx5));
|
|
2852
|
+
|
|
2853
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 || dty != dtx4 || dty != dtx5 ) {
|
|
2854
|
+
ry = rb_ca_template_n(5, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)), rb_ca_wrap_readonly(rx4, INT2NUM(dty)), rb_ca_wrap_readonly(rx5, INT2NUM(dty)));
|
|
2855
|
+
} else {
|
|
2856
|
+
ry = rb_ca_template_n(5, rx1, rx2, rx3, rx4, rx5);
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
ca_call_cslab_6_r(slabfunc, "100000", ry, rx1, rx2, rx3, rx4, rx5, userdata);
|
|
2860
|
+
|
|
2861
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2862
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2863
|
+
}
|
|
2864
|
+
return ry;
|
|
2865
|
+
}
|
|
2866
|
+
|
|
2867
|
+
VALUE
|
|
2868
|
+
ca_call_cslab_1_6_r (int8_t dty, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, int8_t dtx5, int8_t dtx6, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4, volatile VALUE rx5, volatile VALUE rx6, void *userdata)
|
|
2869
|
+
{
|
|
2870
|
+
volatile VALUE ry = Qnil;
|
|
2871
|
+
|
|
2872
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2873
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2874
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2875
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2876
|
+
rx5 = rb_ca_wrap_readonly(rx5, INT2NUM(dtx5));
|
|
2877
|
+
rx6 = rb_ca_wrap_readonly(rx6, INT2NUM(dtx6));
|
|
2878
|
+
|
|
2879
|
+
if ( dty != dtx1 || dty != dtx2 || dty != dtx3 || dty != dtx4 || dty != dtx5 || dty != dtx6 ) {
|
|
2880
|
+
ry = rb_ca_template_n(6, rb_ca_wrap_readonly(rx1, INT2NUM(dty)), rb_ca_wrap_readonly(rx2, INT2NUM(dty)), rb_ca_wrap_readonly(rx3, INT2NUM(dty)), rb_ca_wrap_readonly(rx4, INT2NUM(dty)), rb_ca_wrap_readonly(rx5, INT2NUM(dty)), rb_ca_wrap_readonly(rx6, INT2NUM(dty)));
|
|
2881
|
+
} else {
|
|
2882
|
+
ry = rb_ca_template_n(6, rx1, rx2, rx3, rx4, rx5, rx6);
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
ca_call_cslab_7_r(slabfunc, "1000000", ry, rx1, rx2, rx3, rx4, rx5, rx6, userdata);
|
|
2886
|
+
|
|
2887
|
+
if ( rb_ca_is_scalar(ry) ) {
|
|
2888
|
+
ry = rb_ca_fetch_addr(ry, 0);
|
|
2889
|
+
}
|
|
2890
|
+
return ry;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
VALUE
|
|
2894
|
+
ca_call_cslab_2_1_r (int8_t dty1, int8_t dty2, int8_t dtx1, ca_cslab_r_t slabfunc, volatile VALUE rx1, void *userdata)
|
|
2895
|
+
{
|
|
2896
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2897
|
+
|
|
2898
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2899
|
+
|
|
2900
|
+
if ( dty1 != dtx1 ) {
|
|
2901
|
+
ry1 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)));
|
|
2902
|
+
} else {
|
|
2903
|
+
ry1 = rb_ca_template_n(1, rx1);
|
|
2904
|
+
}
|
|
2905
|
+
if ( dty2 != dtx1 ) {
|
|
2906
|
+
ry2 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)));
|
|
2907
|
+
} else {
|
|
2908
|
+
ry2 = rb_ca_template_n(1, rx1);
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
ca_call_cslab_3_r(slabfunc, "110", ry1, ry2, rx1, userdata);
|
|
2912
|
+
|
|
2913
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2914
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2915
|
+
}
|
|
2916
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2917
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2918
|
+
}
|
|
2919
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
VALUE
|
|
2923
|
+
ca_call_cslab_2_2_r (int8_t dty1, int8_t dty2, int8_t dtx1, int8_t dtx2, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, void *userdata)
|
|
2924
|
+
{
|
|
2925
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2926
|
+
|
|
2927
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2928
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2929
|
+
|
|
2930
|
+
if ( dty1 != dtx1 || dty1 != dtx2 ) {
|
|
2931
|
+
ry1 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)));
|
|
2932
|
+
} else {
|
|
2933
|
+
ry1 = rb_ca_template_n(2, rx1, rx2);
|
|
2934
|
+
}
|
|
2935
|
+
if ( dty2 != dtx1 || dty2 != dtx2 ) {
|
|
2936
|
+
ry2 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)));
|
|
2937
|
+
} else {
|
|
2938
|
+
ry2 = rb_ca_template_n(2, rx1, rx2);
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
ca_call_cslab_4_r(slabfunc, "1100", ry1, ry2, rx1, rx2, userdata);
|
|
2942
|
+
|
|
2943
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2944
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2945
|
+
}
|
|
2946
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2947
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2948
|
+
}
|
|
2949
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2950
|
+
}
|
|
2951
|
+
|
|
2952
|
+
VALUE
|
|
2953
|
+
ca_call_cslab_2_3_r (int8_t dty1, int8_t dty2, int8_t dtx1, int8_t dtx2, int8_t dtx3, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, void *userdata)
|
|
2954
|
+
{
|
|
2955
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2956
|
+
|
|
2957
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2958
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2959
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2960
|
+
|
|
2961
|
+
if ( dty1 != dtx1 || dty1 != dtx2 || dty1 != dtx3 ) {
|
|
2962
|
+
ry1 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)), rb_ca_wrap_readonly(rx3, INT2NUM(dty1)));
|
|
2963
|
+
} else {
|
|
2964
|
+
ry1 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2965
|
+
}
|
|
2966
|
+
if ( dty2 != dtx1 || dty2 != dtx2 || dty2 != dtx3 ) {
|
|
2967
|
+
ry2 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)), rb_ca_wrap_readonly(rx3, INT2NUM(dty2)));
|
|
2968
|
+
} else {
|
|
2969
|
+
ry2 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
ca_call_cslab_5_r(slabfunc, "11000", ry1, ry2, rx1, rx2, rx3, userdata);
|
|
2973
|
+
|
|
2974
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
2975
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
2976
|
+
}
|
|
2977
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
2978
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
2979
|
+
}
|
|
2980
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
VALUE
|
|
2984
|
+
ca_call_cslab_2_4_r (int8_t dty1, int8_t dty2, int8_t dtx1, int8_t dtx2, int8_t dtx3, int8_t dtx4, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, volatile VALUE rx4, void *userdata)
|
|
2985
|
+
{
|
|
2986
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil;
|
|
2987
|
+
|
|
2988
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
2989
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
2990
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
2991
|
+
rx4 = rb_ca_wrap_readonly(rx4, INT2NUM(dtx4));
|
|
2992
|
+
|
|
2993
|
+
if ( dty1 != dtx1 || dty1 != dtx2 || dty1 != dtx3 || dty1 != dtx4 ) {
|
|
2994
|
+
ry1 = rb_ca_template_n(4, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)), rb_ca_wrap_readonly(rx3, INT2NUM(dty1)), rb_ca_wrap_readonly(rx4, INT2NUM(dty1)));
|
|
2995
|
+
} else {
|
|
2996
|
+
ry1 = rb_ca_template_n(4, rx1, rx2, rx3, rx4);
|
|
2997
|
+
}
|
|
2998
|
+
if ( dty2 != dtx1 || dty2 != dtx2 || dty2 != dtx3 || dty2 != dtx4 ) {
|
|
2999
|
+
ry2 = rb_ca_template_n(4, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)), rb_ca_wrap_readonly(rx3, INT2NUM(dty2)), rb_ca_wrap_readonly(rx4, INT2NUM(dty2)));
|
|
3000
|
+
} else {
|
|
3001
|
+
ry2 = rb_ca_template_n(4, rx1, rx2, rx3, rx4);
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
ca_call_cslab_6_r(slabfunc, "110000", ry1, ry2, rx1, rx2, rx3, rx4, userdata);
|
|
3005
|
+
|
|
3006
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
3007
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
3008
|
+
}
|
|
3009
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
3010
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
3011
|
+
}
|
|
3012
|
+
return rb_ary_new3(2, ry1, ry2);
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
VALUE
|
|
3016
|
+
ca_call_cslab_3_1_r (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, ca_cslab_r_t slabfunc, volatile VALUE rx1, void *userdata)
|
|
3017
|
+
{
|
|
3018
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil, ry3 = Qnil;
|
|
3019
|
+
|
|
3020
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
3021
|
+
|
|
3022
|
+
if ( dty1 != dtx1 ) {
|
|
3023
|
+
ry1 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)));
|
|
3024
|
+
} else {
|
|
3025
|
+
ry1 = rb_ca_template_n(1, rx1);
|
|
3026
|
+
}
|
|
3027
|
+
if ( dty2 != dtx1 ) {
|
|
3028
|
+
ry2 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)));
|
|
3029
|
+
} else {
|
|
3030
|
+
ry2 = rb_ca_template_n(1, rx1);
|
|
3031
|
+
}
|
|
3032
|
+
if ( dty3 != dtx1 ) {
|
|
3033
|
+
ry3 = rb_ca_template_n(1, rb_ca_wrap_readonly(rx1, INT2NUM(dty3)));
|
|
3034
|
+
} else {
|
|
3035
|
+
ry3 = rb_ca_template_n(1, rx1);
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
ca_call_cslab_4_r(slabfunc, "1110", ry1, ry2, ry3, rx1, userdata);
|
|
3039
|
+
|
|
3040
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
3041
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
3042
|
+
}
|
|
3043
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
3044
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
3045
|
+
}
|
|
3046
|
+
if ( rb_ca_is_scalar(ry3) ) {
|
|
3047
|
+
ry3 = rb_ca_fetch_addr(ry3, 0);
|
|
3048
|
+
}
|
|
3049
|
+
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3052
|
+
VALUE
|
|
3053
|
+
ca_call_cslab_3_2_r (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, int8_t dtx2, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, void *userdata)
|
|
3054
|
+
{
|
|
3055
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil, ry3 = Qnil;
|
|
3056
|
+
|
|
3057
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
3058
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
3059
|
+
|
|
3060
|
+
if ( dty1 != dtx1 || dty1 != dtx2 ) {
|
|
3061
|
+
ry1 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)));
|
|
3062
|
+
} else {
|
|
3063
|
+
ry1 = rb_ca_template_n(2, rx1, rx2);
|
|
3064
|
+
}
|
|
3065
|
+
if ( dty2 != dtx1 || dty2 != dtx2 ) {
|
|
3066
|
+
ry2 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)));
|
|
3067
|
+
} else {
|
|
3068
|
+
ry2 = rb_ca_template_n(2, rx1, rx2);
|
|
3069
|
+
}
|
|
3070
|
+
if ( dty3 != dtx1 || dty3 != dtx2 ) {
|
|
3071
|
+
ry3 = rb_ca_template_n(2, rb_ca_wrap_readonly(rx1, INT2NUM(dty3)), rb_ca_wrap_readonly(rx2, INT2NUM(dty3)));
|
|
3072
|
+
} else {
|
|
3073
|
+
ry3 = rb_ca_template_n(2, rx1, rx2);
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
ca_call_cslab_5_r(slabfunc, "11100", ry1, ry2, ry3, rx1, rx2, userdata);
|
|
3077
|
+
|
|
3078
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
3079
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
3080
|
+
}
|
|
3081
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
3082
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
3083
|
+
}
|
|
3084
|
+
if ( rb_ca_is_scalar(ry3) ) {
|
|
3085
|
+
ry3 = rb_ca_fetch_addr(ry3, 0);
|
|
3086
|
+
}
|
|
3087
|
+
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
VALUE
|
|
3091
|
+
ca_call_cslab_3_3_r (int8_t dty1, int8_t dty2, int8_t dty3, int8_t dtx1, int8_t dtx2, int8_t dtx3, ca_cslab_r_t slabfunc, volatile VALUE rx1, volatile VALUE rx2, volatile VALUE rx3, void *userdata)
|
|
3092
|
+
{
|
|
3093
|
+
volatile VALUE ry1 = Qnil, ry2 = Qnil, ry3 = Qnil;
|
|
3094
|
+
|
|
3095
|
+
rx1 = rb_ca_wrap_readonly(rx1, INT2NUM(dtx1));
|
|
3096
|
+
rx2 = rb_ca_wrap_readonly(rx2, INT2NUM(dtx2));
|
|
3097
|
+
rx3 = rb_ca_wrap_readonly(rx3, INT2NUM(dtx3));
|
|
3098
|
+
|
|
3099
|
+
if ( dty1 != dtx1 || dty1 != dtx2 || dty1 != dtx3 ) {
|
|
3100
|
+
ry1 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty1)), rb_ca_wrap_readonly(rx2, INT2NUM(dty1)), rb_ca_wrap_readonly(rx3, INT2NUM(dty1)));
|
|
3101
|
+
} else {
|
|
3102
|
+
ry1 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
3103
|
+
}
|
|
3104
|
+
if ( dty2 != dtx1 || dty2 != dtx2 || dty2 != dtx3 ) {
|
|
3105
|
+
ry2 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty2)), rb_ca_wrap_readonly(rx2, INT2NUM(dty2)), rb_ca_wrap_readonly(rx3, INT2NUM(dty2)));
|
|
3106
|
+
} else {
|
|
3107
|
+
ry2 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
3108
|
+
}
|
|
3109
|
+
if ( dty3 != dtx1 || dty3 != dtx2 || dty3 != dtx3 ) {
|
|
3110
|
+
ry3 = rb_ca_template_n(3, rb_ca_wrap_readonly(rx1, INT2NUM(dty3)), rb_ca_wrap_readonly(rx2, INT2NUM(dty3)), rb_ca_wrap_readonly(rx3, INT2NUM(dty3)));
|
|
3111
|
+
} else {
|
|
3112
|
+
ry3 = rb_ca_template_n(3, rx1, rx2, rx3);
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
ca_call_cslab_6_r(slabfunc, "111000", ry1, ry2, ry3, rx1, rx2, rx3, userdata);
|
|
3116
|
+
|
|
3117
|
+
if ( rb_ca_is_scalar(ry1) ) {
|
|
3118
|
+
ry1 = rb_ca_fetch_addr(ry1, 0);
|
|
3119
|
+
}
|
|
3120
|
+
if ( rb_ca_is_scalar(ry2) ) {
|
|
3121
|
+
ry2 = rb_ca_fetch_addr(ry2, 0);
|
|
3122
|
+
}
|
|
3123
|
+
if ( rb_ca_is_scalar(ry3) ) {
|
|
3124
|
+
ry3 = rb_ca_fetch_addr(ry3, 0);
|
|
3125
|
+
}
|
|
3126
|
+
return rb_ary_new3(3, ry1, ry2, ry3);
|
|
3127
|
+
}
|
|
3128
|
+
|