Skip to content

Commit

Permalink
Fix forwarding issue in Match
Browse files Browse the repository at this point in the history
Not sure about this one; fixes off bounds access bug83.cc in gcc
13/RA_DO_CHECK=0/-fno-sanitize=all, broken since
78fa450. gcc 11 has no problem with it.

Also merge optimize.hh in ra.hh.
  • Loading branch information
lloda committed Nov 28, 2023
1 parent ada9b49 commit b3e71f6
Show file tree
Hide file tree
Showing 10 changed files with 158 additions and 186 deletions.
Binary file modified docs/headers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 7 additions & 16 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 11 additions & 13 deletions docs/ra-ra.texi
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
@c http://open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0356r2.html
@c References to source [ma··] or [ma···] current last is 117.

@set VERSION 26
@set UPDATED 2023 November 27
@set VERSION 27
@set UPDATED 2023 November 28

@copying
@code{ra::} (version @value{VERSION}, updated @value{UPDATED})
Expand Down Expand Up @@ -1683,19 +1683,19 @@ Item 2
@section Headers
@c ------------------------------------------------

The header structure of @code{ra::} is as follows.@footnote{Diagram generated using Graphviz and @url{https://www.flourish.org/cinclude2dot}.
The header structure of @code{ra::} is as follows.@c @footnote{Diagram generated using Graphviz and @url{https://www.flourish.org/cinclude2dot}.

@verbatim
cd ra && cinclude2dot.pl --include . > headers.dot
dot -Tpng headers.dot -Gdpi=100 > headers.png
@end verbatim
}
@c @verbatim
@c cd ra && cinclude2dot.pl --include . > headers.dot
@c dot -Tpng headers.dot -Gdpi=100 > headers.png
@c @end verbatim
@c }

@itemize
@item @code{tuples.hh} -
Generic macros and tuple library.
@item @code{bootstrap.hh} -
Basic types, concepts, type predicates, introspection.
Basic types and concepts, introspection.
@item @code{expr.hh} -
Expression template nodes, prefix matching.
@item @code{ply.hh} -
Expand All @@ -1704,10 +1704,8 @@ Traversal, including I/O.
Array type with compile time dimensions.
@item @code{big.hh} -
Array type with run time dimensions.
@item @code{optimize.hh} -
Optimization templates.
@item @code{ra.hh} -
Functions and operators. Main header.
Functions and operators, main header.
@item @code{test.hh} -
(accessory) Testing library.
@item @code{bench.hh} -
Expand All @@ -1716,7 +1714,7 @@ Functions and operators. Main header.
(accessory) Dual number type and operations.
@end itemize

@image{headers,4cm}
@c @image{headers,4cm}

@c ------------------------------------------------
@node Type hierarchy
Expand Down
13 changes: 5 additions & 8 deletions ra/big.hh
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,8 @@ struct View
return select_loop(dim, k, RA_FWD(i) ...);
}
constexpr static dim_t
select_loop(Dim * dim, int k)
{
return 0;
}
// Specialize for rank() integer-args -> scalar, same in ra::SmallBase in small.hh.
select_loop(Dim * dim, int k) { return 0; }

template <class ... I>
constexpr decltype(auto)
operator()(I && ... i) const
Expand Down Expand Up @@ -555,7 +552,7 @@ template <class T, rank_t RANK=ANY> using Unique = Container<std::unique_ptr<T [
template <class T, rank_t RANK=ANY> using Shared = Container<std::shared_ptr<T>, RANK>;

// -------------
// Used in Guile wrappers to let array parameter either borrow from Guile storage or convert into new array (eg 'f32 into 'f64).
// Used in Guile wrappers to let parameter either borrow from Guile storage or convert into new array (eg 'f32 into 'f64).
// TODO Can use unique_ptr's deleter for this?
// TODO Shared/Unique should maybe have constructors with unique_ptr/shared_ptr args
// -------------
Expand All @@ -573,7 +570,7 @@ shared_borrowing(View<T, RANK> & raw)


// --------------------
// Concrete (container) type from array expression.
// concrete (container) type from array expression.
// --------------------

template <class E>
Expand Down Expand Up @@ -660,7 +657,7 @@ with_shape(std::initializer_list<S> && s, X && x)


// --------------------
// Operations specific to View.
// View ops
// --------------------

template <class T, rank_t RANK>
Expand Down
2 changes: 1 addition & 1 deletion ra/bootstrap.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ra {

constexpr int VERSION = 26;
constexpr int VERSION = 27;
// negative rank is used as 'frame rank' in contrast to 'cell rank'. These values limit what can be handled.
constexpr int ANY = -1944444444; // only at ct, meaning tbd at rt
constexpr int BAD = -1988888888; // undefined, eg dead axes
Expand Down
2 changes: 1 addition & 1 deletion ra/expr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ struct Match<checkp, std::tuple<P ...>, mp::int_list<I ...>>
}

constexpr
Match(P ... p_): t(p_ ...) // [ra1]
Match(P ... p_): t(RA_FWD(p_) ...) // [ra1]
{
// TODO Maybe on ply, would make checkp unnecessary, make agree_xxx() unnecessary.
if constexpr (checkp && !(has_len<P> || ...)) {
Expand Down
126 changes: 0 additions & 126 deletions ra/optimize.hh

This file was deleted.

Loading

0 comments on commit b3e71f6

Please sign in to comment.