26 using output_type = std::remove_cvref_t<Output>;
29 return std::same_as<typename output_type::value_type, Scalar>;
31 else if constexpr (Rank == 0)
33 return std::same_as<output_type, Scalar> &&
requires(Output& output,
Scalar value) { output =
value; };
42template <
class Output>
45template <
class Output,
bool = uni20::MdspecLike<Output>>
struct HostOutputType
47 using type = std::remove_cvref_t<Output>;
73 auto output_span = output_access.mdspan();
74 return std::invoke(std::forward<Function>(function), output_span);
78 return std::invoke(std::forward<Function>(function), output);
RAII leases that resolve device descriptors and tensor views to mdspans.
Mutable mdspec metadata supporting host write acquisition.
Definition access.hpp:694
Mdspan metadata whose data handle is immediate or available through a data descriptor.
Definition mdspan/concepts.hpp:304
A mutable mdspan-like type with a specified static rank.
Definition mdspan/concepts.hpp:494
Concept for numeric scalar types (integer, real, or complex).
Definition scalar_concepts.hpp:81
Reduction output that is either a host scalar or host-writable mdspec.
Definition reduction_output.hpp:43
locale_t value
Definition data_table.cpp:49
Allocation-free runtime results for kernel backend attempts.
Mdspan concept and accessor extensions for Uni20.
Definition reduction_output.hpp:21
typename HostOutputType< Output >::type host_output_t
Resolved output type used by a host reduction backend probe.
Definition reduction_output.hpp:56
void write_host_output(Output &output, Scalar value)
Store a scalar in either a resolved rank-zero mdspan or C++ scalar.
Definition reduction_output.hpp:59
consteval bool output_is_supported()
Report whether an output can receive a reduction value of fixed rank.
Definition reduction_output.hpp:24
KernelAttempt with_host_output(Output &output, Function &&function)
Invoke a synchronous reduction with a resolved host output.
Definition reduction_output.hpp:68
KernelAttempt
Result of one runtime kernel backend attempt.
Definition kernel_attempt.hpp:27
std::remove_cvref_t< decltype(std::declval< detail::host_write_mdspan_lease_t< Mdspec > & >().mdspan())> host_write_mdspan_t
Writable mdspan type resolved by host descriptor acquisition.
Definition access.hpp:684
auto acquire_host_write_access_sync(Mdspan &mdspan)
Acquire a directly host-accessible writable mdspan.
Definition access.hpp:626
uni20::host_write_mdspan_t< Output > type
Definition reduction_output.hpp:52
Definition reduction_output.hpp:46
std::remove_cvref_t< Output > type
Definition reduction_output.hpp:47
Concepts for tensor-level objects that resolve mdspan kernel operands.