|
Uni20
Asynchronous tensor and runtime library.
|
Files | |
| file | async_traits.hpp |
| Payload classification and write-through customization for asynchronous values. | |
Concepts | |
| concept | uni20::async::read_buffer_awaitable |
| concept for a valid type that behaves as a read buffer awaitable This requires that the awaiter has a value_type and await_resume() is available. | |
| concept | uni20::async::write_buffer_awaitable |
concept for a valid type that behaves as a write buffer awaitable This requires that value_type x; co_await a = x is valid. | |
| concept | uni20::async::emplace_buffer_awaitable |
| concept for a valid type that supports in-place construction via emplace(...) | |
| concept | uni20::async::emplace_buffer_awaitable_of |
| concept | uni20::async::read_buffer_awaitable_of |
concept for a valid type that behaves as a read buffer awaitable for type T. | |
| concept | uni20::async::write_buffer_awaitable_of |
concept for a valid type that behaves as a write buffer awaitable This requires that T x; co_await a = x is valid. | |
| concept | uni20::async::read_write_buffer_awaitable |
concept for a valid type that behaves as a write buffer that is also readable This requires that value_type x = co_await a; co_await a = x is valid | |
| concept | uni20::async::read_write_buffer_awaitable_of |
concept for a valid type that behaves as a write buffer that is also readable This requires that T x = co_await a; co_await a = x is valid | |
| concept | uni20::async::async_reader |
An async_reader is satisfied if .read() returns an async read buffer. | |
| concept | uni20::async::async_writer |
An async_writer is satisfied if .write() returns a buffer supporting emplace(...). | |
| concept | uni20::async::async_reader_of |
| concept | uni20::async::async_writer_to |
Concept requiring an async writer that accepts values constructible from T. | |
| concept | uni20::async::async_movable_to |
| Concept for an Awaitable that yields a movable object that can be moved into T. | |
| concept | uni20::async::async_mutable_writer_of |
| concept | uni20::async::async_read_writer |
| Concept for a type that behaves like an asynchronous writer that is also readable: it has a write() function that returns an awaiter that can be assigned from the nested value_type, and also read from. | |
| concept | uni20::async::async_like |
| Concept for a type that behaves like an asynchronous reader and writer (like Async<T>). | |
| concept | uni20::async::async_binary_applicable |
| Concept to determine if Op(T,U) is a candidate for forwarding for Async. | |
| concept | uni20::async::async_binary_assignable |
| concept for validating a binary operation true if the operation result can be emplaced into the writer output type. | |
| concept | uni20::async::is_async_compound_applicable |
Macros | |
| #define | UNI20_DEFINE_ASSIGN_OP(NAME, OP) |
| #define | UNI20_DEFINE_ASYNC_COMPOUND_OPERATOR(OPSYM, FUNCTOR) |
| #define | UNI20_DEFINE_BINARY_OP(OPNAME, OP) |
Typedefs | |
| template<typename T , typename U , typename Op > | |
| using | uni20::async::async_binary_result_t = decltype(std::declval< Op >()(std::declval< async_value_t< T > >(), std::declval< async_value_t< U > >())) |
| Result type of applying binary op Op to async_value_t<T>, async_value_t | |
| template<typename AsyncLike > | |
| using | uni20::async::take_awaiter_t = decltype(std::declval< write_buffer_t< AsyncLike > & >().take()) |
Alias for the awaiter type returned by write_buffer_t::take(). | |
| template<typename AsyncLike > | |
| using | uni20::async::write_buffer_t = decltype(std::declval< AsyncLike & >().write()) |
Alias for the write-buffer type produced by write() on an lvalue. | |
Functions | |
| template<typename T , typename U > requires (detail::current_value_assignment_source<T, U> || (is_async_alias_v<T> && detail::async_alias_assignable_from<T, async_value_t<U> const&>)) | |
| void | uni20::async::async_assign (Async< T > &lhs, U &&rhs) |
| Assigns an Async or scalar value into an Async destination. | |
| template<typename T , typename U > requires (!is_async_alias_v<T> && read_buffer_awaitable_of<U, T> && detail::write_proxy_assignable_source<T, T>) | |
| void | uni20::async::async_assign (WriteBuffer< T > destination, U &&source) |
| Assign an awaitable value into an existing independent-value timeline. | |
| template<typename A , typename B , async_writer Writer, typename Op > requires async_binary_applicable<A, B, Op> | |
| void | uni20::async::async_binary_op (Writer &out, A &&a, B &&b, Op op) |
| Launch a coroutine computing result = op(a, b) | |
| template<typename T , typename U , typename Op > | |
| void | uni20::async::async_compound_op (Async< T > &lhs, U &&rhs, Op op) |
Launch a coroutine applying an in-place operation op(lhs, rhs). | |
| template<typename T , typename U > requires (!is_async_alias_v<T> && detail::async_source<U> && std::constructible_from<T, async_value_t<U> const&>) | |
| void | uni20::async::async_initialize (Async< T > &destination, U &&source) |
| Initialize a fresh independent async value from another async source. | |
| template<typename T , typename U > requires (!is_async_alias_v<T> && detail::async_initialization_awaitable<U, T>) | |
| void | uni20::async::async_initialize (WriteBuffer< T > destination, U &&source) |
| Initialize empty independent-value storage from an awaitable source. | |
| template<typename T , typename U > requires (!is_async_alias_v<T>) | |
| void | uni20::async::async_move (Async< T > &lhs, U &&rhs) |
| Move-assign from a source expression into an Async destination. | |
| template<typename T , typename U > requires (!is_async_alias_v<T>) && async_mutable_writer_of<U, T> && async_movable_to<U, T> | |
| void | uni20::async::async_move (WriteBuffer< T > lhs, U &&rhs) |
| template<typename T , typename U > requires read_buffer_awaitable_of<U, T> | |
| void | uni20::async::async_negate (WriteBuffer< T > lhs, U &&rhs) |
| Negate a source value asynchronously and write into a destination buffer. | |
| template<typename T > requires requires(T t) { -t; } | |
| auto | uni20::async::operator- (Async< T > const &x) |
| Unary negation overload for Async values. | |
| #define UNI20_DEFINE_ASSIGN_OP | ( | NAME, | |
| OP | |||
| ) |
| #define UNI20_DEFINE_ASYNC_COMPOUND_OPERATOR | ( | OPSYM, | |
| FUNCTOR | |||
| ) |
| #define UNI20_DEFINE_BINARY_OP | ( | OPNAME, | |
| OP | |||
| ) |
| using uni20::async::async_binary_result_t = typedef decltype(std::declval<Op>()(std::declval<async_value_t<T> >(), std::declval<async_value_t<U> >())) |
Result type of applying binary op Op to async_value_t<T>, async_value_t
| using uni20::async::take_awaiter_t = typedef decltype(std::declval<write_buffer_t<AsyncLike>&>().take()) |
Alias for the awaiter type returned by write_buffer_t::take().
| using uni20::async::write_buffer_t = typedef decltype(std::declval<AsyncLike&>().write()) |
Alias for the write-buffer type produced by write() on an lvalue.
| void uni20::async::async_assign | ( | Async< T > & | lhs, |
| U && | rhs | ||
| ) |
| void uni20::async::async_assign | ( | WriteBuffer< T > | destination, |
| U && | source | ||
| ) |
Assign an awaitable value into an existing independent-value timeline.
The destination may already be constructed, so this operation requires both construction and assignment capability.
| void uni20::async::async_binary_op | ( | Writer & | out, |
| A && | a, | ||
| B && | b, | ||
| Op | op | ||
| ) |
Launch a coroutine computing result = op(a, b)
Constructs read/write buffers in dependency order and schedules the operation.
| A | First operand (scalar or Async<T>) |
| B | Second operand (scalar or Async) |
| R | Result value type |
| Op | Callable with signature R(op(A, B)) |
| void uni20::async::async_compound_op | ( | Async< T > & | lhs, |
| U && | rhs, | ||
| Op | op | ||
| ) |
Launch a coroutine applying an in-place operation op(lhs, rhs).
The left operand contributes one exclusive WriteBuffer, which supplies access to its existing value. The right operand is a distinct reader or immediate value.
| U | Right-hand operand type (scalar or Async) |
| T | Value type of the Async<T> being modified |
| Op | Callable with signature void(T&, U const&) |
| lhs | Left-hand operand of the form Async<T>& — this is the value being modified |
| rhs | Right-hand operand (either U or Async) |
| op | In-place operation to apply (e.g., a lambda using operator+=) |
| void uni20::async::async_initialize | ( | Async< T > & | destination, |
| U && | source | ||
| ) |
Initialize a fresh independent async value from another async source.
| void uni20::async::async_initialize | ( | WriteBuffer< T > | destination, |
| U && | source | ||
| ) |
Initialize empty independent-value storage from an awaitable source.
This is used for fresh value timelines and deliberately requires construction but not assignment of T.
| void uni20::async::async_move | ( | Async< T > & | lhs, |
| U && | rhs | ||
| ) |
Move-assign from a source expression into an Async destination.
| T | Destination value type. |
| U | Source type. |
| lhs | Destination async value. |
| rhs | Source expression. |
| void uni20::async::async_move | ( | WriteBuffer< T > | lhs, |
| U && | rhs | ||
| ) |
| void uni20::async::async_negate | ( | WriteBuffer< T > | lhs, |
| U && | rhs | ||
| ) |
Negate a source value asynchronously and write into a destination buffer.
| U | Source type. |
| T | Destination value type. |
| lhs | Destination write buffer. |
| rhs | Source expression. |