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

Concepts for tensor-level objects that resolve mdspan kernel operands. More...

#include <uni20/mdspan/concepts.hpp>
#include <concepts>
#include <cstddef>
#include <type_traits>
#include <utility>
Include dependency graph for tensor/concepts.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::TensorView
 Tensor-level object exposing readable multidimensional metadata and a backend selector.
 
concept  uni20::ImmediateTensorView
 TensorView whose mdspec is already an mdspan.
 
concept  uni20::OwningTensor
 Tensor-level object that owns the storage described by its multidimensional view.
 
concept  uni20::MutableTensorView
 TensorView whose writable mdspec supports eventual element assignment.
 
concept  uni20::MutableImmediateTensorView
 MutableTensorView whose writable mdspec is already an mdspan.
 
concept  uni20::RankedTensorView
 TensorView whose readable mdspec has a specified static rank.
 
concept  uni20::StridedTensorView
 TensorView whose readable mdspec is strided.
 
concept  uni20::MutableStridedTensorView
 MutableTensorView whose readable and writable mdspecs are strided.
 
concept  uni20::RankedStridedTensorView
 StridedTensorView with a specified static rank.
 
concept  uni20::MutableRankedTensorView
 MutableTensorView with a specified static rank.
 
concept  uni20::ScalarTensorView
 TensorView whose readable mdspec has rank zero.
 
concept  uni20::MutableScalarTensorView
 MutableTensorView whose writable mdspec has rank zero.
 
concept  uni20::MutableRankedStridedTensorView
 Mutable strided TensorView with a specified static rank.
 
concept  uni20::StridedImmediateTensorView
 ImmediateTensorView whose readable mdspan is strided.
 
concept  uni20::MutableStridedImmediateTensorView
 MutableImmediateTensorView whose readable and writable mdspans are strided.
 
concept  uni20::RankedImmediateTensorView
 ImmediateTensorView whose readable mdspan has a specified static rank.
 
concept  uni20::MutableRankedImmediateTensorView
 MutableImmediateTensorView whose writable mdspan has a specified static rank.
 
concept  uni20::ScalarImmediateTensorView
 Tensor-level object whose readable resolved mdspan has rank zero.
 
concept  uni20::MutableScalarImmediateTensorView
 Mutable tensor-level object whose writable resolved mdspan has rank zero.
 
concept  uni20::RankedStridedImmediateTensorView
 Strided tensor-level object whose resolved mdspan has a specified static rank.
 
concept  uni20::MutableRankedStridedImmediateTensorView
 Mutable strided tensor-level object whose resolved mdspan has a specified static rank.
 

Typedefs

template<ImmediateTensorView T>
using uni20::immediate_tensor_mdspan_t = std::remove_cvref_t< detail::tensor_const_mdspan_t< T > >
 Resolved readable mdspan type exposed by a tensor-level object.
 
template<MutableImmediateTensorView T>
using uni20::mutable_immediate_tensor_mdspan_t = std::remove_cvref_t< detail::tensor_mutable_mdspan_t< T > >
 Resolved writable mdspan type exposed by a mutable tensor-level object.
 
template<MutableTensorView T>
using uni20::mutable_tensor_mdspec_t = std::remove_cvref_t< detail::normalized_mutable_mdspec_t< T > >
 Normalized writable MdspecLike type exposed by a mutable tensor-level object.
 
template<TensorView T>
using uni20::tensor_element_t = std::remove_cv_t< typename tensor_mdspec_t< T >::element_type >
 Scalar value type exposed by a tensor-level object.
 
template<TensorView T>
using uni20::tensor_extents_t = typename tensor_mdspec_t< T >::extents_type
 Extents type exposed by a tensor-level object.
 
template<TensorView T>
using uni20::tensor_mdspec_t = std::remove_cvref_t< detail::normalized_const_mdspec_t< T > >
 Normalized readable MdspecLike type exposed by a tensor-level object.
 
template<class Tensor >
using uni20::tensor_storage_policy_t = typename detail::TensorStoragePolicy< std::remove_cvref_t< Tensor > >::type
 Storage-policy type exposed by a tensor-level object, or void.
 

Functions

template<MutableTensorView Output, TensorView Input>
requires (tensor_mdspec_t<Output>::rank() == tensor_mdspec_t<Input>::rank())
void uni20::assign_through (Output &output, Input const &input)
 Assign tensor values through a mutable tensor alias descriptor.
 
template<class Tensor >
requires ( !requires(Tensor& tensor) { tensor.mdspec(); } && requires(Tensor& tensor) { tensor.mdspan(); })
constexpr decltype(auto) uni20::mdspec_of (Tensor &tensor) noexcept(noexcept(tensor.mdspan()))
 Return an immediate tensor's mdspan as its mdspec representation.
 
template<class Tensor >
requires requires(Tensor& tensor) { tensor.mdspec(); }
constexpr decltype(auto) uni20::mdspec_of (Tensor &tensor) noexcept(noexcept(tensor.mdspec()))
 Return a tensor's immediate or descriptor-backed multidimensional metadata.
 
template<StridedTensorView T>
auto uni20::strides (T const &tensor)
 Retrieve the normalized multidimensional strides of a tensor-level object.
 

Variables

template<class T >
constexpr bool uni20::enable_owning_tensor = false
 Opt-in marker for tensor types that own their storage and lifetime.
 

Detailed Description

Concepts for tensor-level objects that resolve mdspan kernel operands.