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

Async Tensor wrappers for full and axis-selective sums. More...

#include <uni20/async/async.hpp>
#include <uni20/async/awaiters.hpp>
#include <uni20/async/debug_scheduler.hpp>
#include <uni20/common/trace.hpp>
#include <uni20/linalg/async/detail/output.hpp>
#include <uni20/tensor/reductions.hpp>
#include <concepts>
#include <cstddef>
#include <memory>
#include <tuple>
#include <utility>
Include dependency graph for linalg/async/reductions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  uni20
 

Functions

template<TensorView LhsTensor, TensorView RhsTensor>
requires detail::CompatibleInnerProductTensors<LhsTensor, RhsTensor> && detail::ReductionResultAvailable<tensor_element_t<LhsTensor>, LhsTensor, RhsTensor>
auto uni20::inner_product (async::Async< LhsTensor > const &lhs, async::Async< RhsTensor > const &rhs)
 Return an async storage-preserving Tensor inner product using static Tensor policy.
 
template<AsyncTensorOutput OutputTensor, TensorView LhsTensor, TensorView RhsTensor>
requires MutableScalarTensorView<OutputTensor> && detail::CompatibleInnerProductTensors<LhsTensor, RhsTensor> && std::same_as<tensor_element_t<OutputTensor>, tensor_element_t<LhsTensor>>
void uni20::inner_product (async::Async< OutputTensor > &output, async::Async< LhsTensor > const &lhs, async::Async< RhsTensor > const &rhs)
 Schedule an inner product into an explicit async scalar Tensor using storage policy.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView LhsTensor, TensorView RhsTensor>
requires detail::CompatibleInnerProductTensors<LhsTensor, RhsTensor> && detail::ReductionResultAvailable<tensor_element_t<LhsTensor>, LhsTensor, RhsTensor>
auto uni20::inner_product (BackendSelector selector, async::Async< LhsTensor > const &lhs, async::Async< RhsTensor > const &rhs)
 Return an async storage-preserving Tensor inner product through an explicit selector.
 
template<linalg::KernelBackendSelector BackendSelector, AsyncTensorOutput OutputTensor, TensorView LhsTensor, TensorView RhsTensor>
requires MutableScalarTensorView<OutputTensor> && detail::CompatibleInnerProductTensors<LhsTensor, RhsTensor> && std::same_as<tensor_element_t<OutputTensor>, tensor_element_t<LhsTensor>>
void uni20::inner_product (BackendSelector selector, async::Async< OutputTensor > &output, async::Async< LhsTensor > const &lhs, async::Async< RhsTensor > const &rhs)
 Schedule an inner product into an explicit async scalar Tensor.
 
template<TensorView LhsTensor, TensorView RhsTensor>
requires detail::CompatibleInnerProductTensors<LhsTensor, RhsTensor>
auto uni20::inner_product_host (async::Async< LhsTensor > const &lhs, async::Async< RhsTensor > const &rhs)
 Return a nonblocking async host C++ scalar inner product using static Tensor policy.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView LhsTensor, TensorView RhsTensor>
requires detail::CompatibleInnerProductTensors<LhsTensor, RhsTensor>
auto uni20::inner_product_host (BackendSelector selector, async::Async< LhsTensor > const &lhs, async::Async< RhsTensor > const &rhs)
 Return a nonblocking async host C++ scalar inner product through an explicit selector.
 
template<TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>> && detail::ReductionResultAvailable<make_real_t<tensor_element_t<InputTensor>>, InputTensor>
auto uni20::norm (async::Async< InputTensor > const &input)
 Return an async storage-preserving real Tensor norm using static Tensor policy.
 
template<AsyncTensorOutput OutputTensor, TensorView InputTensor>
requires MutableScalarTensorView<OutputTensor> && RealOrComplex<tensor_element_t<InputTensor>> && std::same_as<tensor_element_t<OutputTensor>, make_real_t<tensor_element_t<InputTensor>>>
void uni20::norm (async::Async< OutputTensor > &output, async::Async< InputTensor > const &input)
 Schedule a Euclidean norm into an explicit async scalar Tensor using storage policy.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>> && detail::ReductionResultAvailable<make_real_t<tensor_element_t<InputTensor>>, InputTensor>
auto uni20::norm (BackendSelector selector, async::Async< InputTensor > const &input)
 Return an async storage-preserving real Tensor norm through an explicit selector.
 
template<linalg::KernelBackendSelector BackendSelector, AsyncTensorOutput OutputTensor, TensorView InputTensor>
requires MutableScalarTensorView<OutputTensor> && RealOrComplex<tensor_element_t<InputTensor>> && std::same_as<tensor_element_t<OutputTensor>, make_real_t<tensor_element_t<InputTensor>>>
void uni20::norm (BackendSelector selector, async::Async< OutputTensor > &output, async::Async< InputTensor > const &input)
 Schedule a Euclidean norm into an explicit async scalar Tensor.
 
template<TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>>
auto uni20::norm_host (async::Async< InputTensor > const &input)
 Return a nonblocking async host C++ scalar norm using static Tensor policy.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>>
auto uni20::norm_host (BackendSelector selector, async::Async< InputTensor > const &input)
 Return a nonblocking async host C++ scalar norm through an explicit selector.
 
template<TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>> && detail::ReductionResultAvailable<tensor_element_t<InputTensor>, InputTensor>
auto uni20::sum (async::Async< InputTensor > const &input)
 Return an async storage-preserving full Tensor sum using storage policy.
 
template<TensorView InputTensor, linalg::ReductionAxis FirstAxis, linalg::ReductionAxis... RestAxes>
requires RealOrComplex<tensor_element_t<InputTensor>> && (1 + sizeof...(RestAxes) <= tensor_mdspec_t<InputTensor>::rank()) && detail::ReductionResultAvailable<tensor_element_t<InputTensor>, InputTensor>
auto uni20::sum (async::Async< InputTensor > const &input, FirstAxis first_axis, RestAxes... rest_axes)
 Return an async storage-preserving sum over selected axes using storage policy.
 
template<AsyncTensorOutput OutputTensor, TensorView InputTensor>
requires MutableScalarTensorView<OutputTensor> && RealOrComplex<tensor_element_t<InputTensor>> && std::same_as<tensor_element_t<OutputTensor>, tensor_element_t<InputTensor>>
void uni20::sum (async::Async< OutputTensor > &output, async::Async< InputTensor > const &input)
 Schedule a full sum into an explicit async scalar tensor using storage policy.
 
template<AsyncTensorOutput OutputTensor, TensorView InputTensor, linalg::ReductionAxis FirstAxis, linalg::ReductionAxis... RestAxes>
requires RealOrComplex<tensor_element_t<InputTensor>> && std::same_as<tensor_element_t<OutputTensor>, tensor_element_t<InputTensor>> && (1 + sizeof...(RestAxes) <= tensor_mdspec_t<InputTensor>::rank()) && (mutable_tensor_mdspec_t<OutputTensor>::rank() + 1 + sizeof...(RestAxes) == tensor_mdspec_t<InputTensor>::rank())
void uni20::sum (async::Async< OutputTensor > &output, async::Async< InputTensor > const &input, FirstAxis first_axis, RestAxes... rest_axes)
 Schedule an axis-selective sum into an explicit async output using storage policy.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>> && detail::ReductionResultAvailable<tensor_element_t<InputTensor>, InputTensor>
auto uni20::sum (BackendSelector selector, async::Async< InputTensor > const &input)
 Return an async storage-preserving full Tensor sum through an explicit selector.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView InputTensor, linalg::ReductionAxis FirstAxis, linalg::ReductionAxis... RestAxes>
requires RealOrComplex<tensor_element_t<InputTensor>> && (1 + sizeof...(RestAxes) <= tensor_mdspec_t<InputTensor>::rank()) && detail::ReductionResultAvailable<tensor_element_t<InputTensor>, InputTensor>
auto uni20::sum (BackendSelector selector, async::Async< InputTensor > const &input, FirstAxis first_axis, RestAxes... rest_axes)
 Return an async storage-preserving sum over selected axes.
 
template<linalg::KernelBackendSelector BackendSelector, AsyncTensorOutput OutputTensor, TensorView InputTensor>
requires MutableScalarTensorView<OutputTensor> && RealOrComplex<tensor_element_t<InputTensor>> && std::same_as<tensor_element_t<OutputTensor>, tensor_element_t<InputTensor>>
void uni20::sum (BackendSelector selector, async::Async< OutputTensor > &output, async::Async< InputTensor > const &input)
 Schedule a full sum into an explicit async scalar tensor.
 
template<linalg::KernelBackendSelector BackendSelector, AsyncTensorOutput OutputTensor, TensorView InputTensor, linalg::ReductionAxis FirstAxis, linalg::ReductionAxis... RestAxes>
requires RealOrComplex<tensor_element_t<InputTensor>> && std::same_as<tensor_element_t<OutputTensor>, tensor_element_t<InputTensor>> && (1 + sizeof...(RestAxes) <= tensor_mdspec_t<InputTensor>::rank()) && (mutable_tensor_mdspec_t<OutputTensor>::rank() + 1 + sizeof...(RestAxes) == tensor_mdspec_t<InputTensor>::rank())
void uni20::sum (BackendSelector selector, async::Async< OutputTensor > &output, async::Async< InputTensor > const &input, FirstAxis first_axis, RestAxes... rest_axes)
 Schedule an axis-selective sum into an explicit async output.
 
template<TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>>
auto uni20::sum_host (async::Async< InputTensor > const &input)
 Return a nonblocking async host C++ scalar sum using storage policy.
 
template<linalg::KernelBackendSelector BackendSelector, TensorView InputTensor>
requires RealOrComplex<tensor_element_t<InputTensor>>
auto uni20::sum_host (BackendSelector selector, async::Async< InputTensor > const &input)
 Return a nonblocking async host C++ scalar sum through an explicit selector.
 

Detailed Description

Async Tensor wrappers for full and axis-selective sums.