Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Namespaces | Concepts | Functions
output.hpp File Reference

Shape preparation contracts for tensor operation outputs. More...

#include <uni20/async/shared_storage.hpp>
#include <uni20/common/initialization.hpp>
#include <uni20/common/trace.hpp>
#include <uni20/core/runtime_precision.hpp>
#include <uni20/tensor/concepts.hpp>
#include <concepts>
#include <cstddef>
#include <type_traits>
#include <utility>
Include dependency graph for tensor/output.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  uni20
 

Concepts

concept  uni20::TensorExtentsLike
 Extents-like shape accepted by tensor output preparation.
 
concept  uni20::ResizableTensorOutput
 Mutable tensor output that can replace its shape and storage.
 

Functions

template<class TargetExtents , TensorExtentsLike SourceExtents>
TargetExtents uni20::convert_tensor_extents (SourceExtents const &source)
 Convert tensor extents while validating the target's static extents.
 
template<MutableTensorView Output, TensorExtentsLike RequiredExtents>
Output & uni20::prepare_output (async::shared_storage< Output > &storage, RequiredExtents const &required)
 Construct or resize a deferred Tensor output to the required shape.
 
template<MutableTensorView Output, TensorExtentsLike RequiredExtents, class Placement >
requires std::constructible_from<Output, Placement const&, tensor_extents_t<Output> const&> && requires(Output& output, tensor_extents_t<Output> const& extents, Placement const& placement) { prepare_output(output, extents, placement); }
Output & uni20::prepare_output (async::shared_storage< Output > &storage, RequiredExtents const &required, Placement const &placement)
 Construct or replace a deferred Tensor output with compatible shape and storage.
 
template<MutableTensorView Output, TensorExtentsLike RequiredExtents>
requires (!has_runtime_precision_v<tensor_element_t<Output>> || std::constructible_from<Output, uninitialized_t, tensor_extents_t<Output> const&, Precision>)
Output & uni20::prepare_output (async::shared_storage< Output > &storage, RequiredExtents const &required, Precision p)
 Construct or resize a deferred output at an explicit working precision.
 
template<MutableTensorView Output, TensorExtentsLike RequiredExtents>
Output & uni20::prepare_output (Output &output, RequiredExtents const &required)
 Prepare a mutable tensor output with the specified shape.
 
template<MutableTensorView Output, TensorExtentsLike RequiredExtents, class Placement >
requires requires(Output& output, tensor_extents_t<Output> const& extents, Placement const& placement) { { output.storage_is_compatible(placement) } -> std::convertible_to<bool>; output.reset_shape(extents); output.replace(extents, placement); }
Output & uni20::prepare_output (Output &output, RequiredExtents const &required, Placement const &placement)
 Prepare a mutable Tensor output with compatible shape and storage.
 
template<MutableTensorView Output, TensorExtentsLike RequiredExtents>
Output & uni20::prepare_output (Output &output, RequiredExtents const &required, Precision p)
 Prepare an output at compatible precision, recording runtime defaults on owning outputs.
 
template<TensorView Output, TensorExtentsLike RequiredExtents>
void uni20::require_output (Output const &output, RequiredExtents const &required)
 Require an existing tensor output to have the specified shape.
 
template<TensorExtentsLike LhsExtents, TensorExtentsLike RhsExtents>
constexpr bool uni20::tensor_extents_equal (LhsExtents const &lhs, RhsExtents const &rhs) noexcept
 Compare two tensor extent objects by rank and per-axis extent.
 

Detailed Description

Shape preparation contracts for tensor operation outputs.