11#include <fmt/format.h>
39 auto input_buffer =
co_await in.
transfer();
40 auto const input = input_buffer.get();
42 co_await out =
sin(input);
63 auto input_buffer =
co_await in.
transfer();
64 auto const input = input_buffer.get();
66 co_await out =
cos(input);
86 auto input_buffer =
co_await in.
transfer();
87 auto const input = input_buffer.get();
110 auto input_buffer =
co_await in.
transfer();
111 auto const input = input_buffer.get();
113 co_await out = real(input);
134 auto input_buffer =
co_await in.
transfer();
135 auto const input = input_buffer.get();
137 co_await out = imag(input);
158 auto input_buffer =
co_await in.
transfer();
159 auto const input = input_buffer.get();
161 co_await out =
herm(input);
182 auto x =
co_await in;
183 fmt::print(fmt::runtime(Format), x);
184 }(std::move(Format), x.
read()));
194 fmt::print(
"{}", Prompt);
197 co_await out = std::move(
value);
198 }(std::move(Prompt), x.
write()));
Canonical host-oriented coroutine task type.
Definition async_task.hpp:196
Async<T> is a container for coroutine-safe asynchronous read/write.
Definition async/async.hpp:93
ReadBuffer< T > read() const
Begin an asynchronous read of the value.
Definition async/async.hpp:339
WriteBuffer< T > write()
Begin exclusive asynchronous access to the payload.
Definition async/async.hpp:346
RAII handle for reading the value from an Async container at a given epoch.
Definition buffers.hpp:53
void release() noexcept
Manually release the epoch reader before awaitable destruction.
Definition buffers.hpp:143
ReadBuffer && transfer() &noexcept
Transfer this read buffer into the owning-await path.
Definition buffers.hpp:147
Exclusive mutable-access buffer for one Async<T> epoch.
Definition buffers.hpp:859
locale_t value
Definition data_table.cpp:49
uni20::complex< T > conj(detail::standard_complex< T > x)
Returns the complex conjugate for complex-valued scalars.
Definition math.hpp:70
constexpr T & imag(detail::standard_complex< T > &z) noexcept
Provides mutable access to the imaginary component of a uni20::complex value.
Definition math.hpp:184
typename make_real< T >::type make_real_t
Alias for the underlying real-valued type of T.
Definition scalar_traits.hpp:168
constexpr T & real(detail::standard_complex< T > &z) noexcept
Provides mutable access to the real component of a uni20::complex value.
Definition math.hpp:173
Scalar math helper utilities.
This represents the reverse-mode adjoint for functions of complex variables, assuming a real-valued s...
Definition async/async.hpp:26
void schedule(AsyncTask &&task)
Schedule a task on the currently configured global scheduler.
Definition debug_scheduler.hpp:237
AsyncTask co_conj(ReadBuffer< T > in, WriteBuffer< T > out)
Coroutine implementation of complex conjugation over async buffers.
Definition async_toys.hpp:84
AsyncTask co_real(ReadBuffer< T > in, WriteBuffer< uni20::make_real_t< T > > out)
Coroutine implementation of real-part extraction over async buffers.
Definition async_toys.hpp:107
AsyncTask co_herm(ReadBuffer< T > in, WriteBuffer< T > out)
Coroutine implementation of Hermitian conjugation over async buffers.
Definition async_toys.hpp:155
AsyncTask co_cos(ReadBuffer< T > in, WriteBuffer< T > out)
Coroutine implementation of cos over async buffers.
Definition async_toys.hpp:60
Async< T > sin(Async< T > const &x)
Schedules asynchronous sine evaluation.
Definition async_toys.hpp:49
Async< T > cos(Async< T > const &x)
Schedules asynchronous cosine evaluation.
Definition async_toys.hpp:73
Async< T > conj(Async< T > const &x)
Schedules asynchronous conjugation.
Definition async_toys.hpp:96
void async_print(std::string Format, Async< T > x)
Schedules a formatted print once an async value is ready.
Definition async_toys.hpp:179
AsyncTask co_sin(ReadBuffer< T > in, WriteBuffer< T > out)
Coroutine implementation of sin over async buffers.
Definition async_toys.hpp:22
void async_read(std::string Prompt, Async< T > &x)
Schedules reading a value from std::cin into an async slot.
Definition async_toys.hpp:191
Async< T > herm(Async< T > const &x)
Schedules asynchronous Hermitian conjugation.
Definition async_toys.hpp:168
AsyncTask co_imag(ReadBuffer< T > in, WriteBuffer< uni20::make_real_t< T > > out)
Coroutine implementation of imaginary-part extraction over async buffers.
Definition async_toys.hpp:131
Defines internal task routing and the host-oriented scheduler interface.
Async aliases for lazy tensor-level views.