diff --git a/README.md b/README.md index f673102..1a3641b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ **ra-ra** implements [expression templates](https://en.wikipedia.org/wiki/Expression_templates). This is a C++ technique (pioneered by [Blitz++](http://blitz.sourceforge.net)) to delay the execution of expressions involving array operands, and in this way avoid the unnecessary creation of large temporary array objects. -**ra-ra** is compact (≈5k loc), easy to extend, and generic. There are no arbitrary type restrictions or limits on rank or argument count. +**ra-ra** is compact (<5k loc), easy to extend, and generic. There are no arbitrary type restrictions or limits on rank or argument count. In this example ([examples/read-me.cc](examples/read-me.cc)), we create some arrays, do operations on them, and print the result. diff --git a/ra/ply.hh b/ra/ply.hh index 5353004..1e6a3ac 100644 --- a/ra/ply.hh +++ b/ra/ply.hh @@ -261,7 +261,7 @@ ply_fixed(A && a, Early && early = Nop {}) constexpr rank_t rank = rank_s(); static_assert(0<=rank, "ply_fixed needs static rank"); // inside first. FIXME better heuristic - but first need a way to force row-major - constexpr /* static P2647 gcc13 */ auto order = mp::tuple2array>>(); + constexpr auto order = mp::tuple2array>>(); if constexpr (0==rank) { if constexpr (requires {early.def;}) { return (*a).value_or(early.def); @@ -270,9 +270,9 @@ ply_fixed(A && a, Early && early = Nop {}) return; } } else { - auto ss0 = a.step(order[0]); // static keep_step implies all else is static. if constexpr (RA_STATIC_UNROLL && rank>1 && requires (dim_t st, rank_t z, rank_t j) { A::keep_step(st, z, j); }) { + constexpr auto ss0 = a.step(order[0]); // find outermost compact dim. constexpr auto sj = [&order] { @@ -291,6 +291,7 @@ ply_fixed(A && a, Early && early = Nop {}) } else { #pragma GCC diagnostic push // gcc 12.2 and 13.2 with RA_DO_CHECK=0 and -fno-sanitize=all #pragma GCC diagnostic warning "-Warray-bounds" + auto ss0 = a.step(order[0]); // gcc 14.1 with RA_DO_CHECK=0 and sanitizer on // not worth unrolling. if constexpr (requires {early.def;}) { return (subply(a, a.len(order[0]), ss0, early)).value_or(early.def);