Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
ops/matrix_exponential.hpp
Go to the documentation of this file.
1#pragma once
2
13
14#include <utility>
15
16namespace uni20::linalg
17{
18
28template <class BackendSelector, uni20::MutableRankedTensorView<2> OutputTensor, uni20::RankedTensorView<2> InputTensor,
29 class TimeScalar>
30void matrix_exponential(BackendSelector&& selector, OutputTensor&& output, InputTensor const& input, TimeScalar time)
31{
32 auto output_descriptor = uni20::mdspec_of(output);
33 auto input_descriptor = uni20::mdspec_of(input);
34 dispatch_kernel(std::forward<BackendSelector>(selector), matrix_exponential_op{}, output_descriptor, input_descriptor,
35 time);
36}
37
39template <uni20::MutableRankedTensorView<2> OutputTensor, uni20::RankedTensorView<2> InputTensor, class TimeScalar>
40void matrix_exponential(OutputTensor&& output, InputTensor const& input, TimeScalar time)
41{
42 auto selector = select_backend(matrix_exponential_op{}, output, input);
43 matrix_exponential(selector, std::forward<OutputTensor>(output), input, time);
44}
45
46} // namespace uni20::linalg
CPU dense matrix exponential interface and dispatch adapter.
Operation-tag backend dispatch over tensor-view operands.
Definition linalg/async.hpp:28
constexpr auto select_backend(Operation const &operation, FirstTensor const &, RestTensors const &...)
Select the default backend list for an operation on Tensor operands.
Definition backend_selector.hpp:252
void dispatch_kernel(BackendSelector &&selector, Op op, Args &&... args)
Normalize a selector and dispatch or report that every eligible backend declined.
Definition dispatch.hpp:374
void matrix_exponential(BackendSelector selector, async::Async< OutputTensor > &output, async::Async< InputTensor > const &input, TimeScalar &&time)
Schedule fixed-output matrix exponentiation through an explicit selector.
Definition async/matrix_exponential.hpp:64
constexpr decltype(auto) mdspec_of(Tensor &tensor) noexcept(noexcept(tensor.mdspec()))
Return a tensor's immediate or descriptor-backed multidimensional metadata.
Definition tensor/concepts.hpp:50
Backend-independent operation values used with normalized kernel operands.
Dense matrix exponential operation tag.
Definition operation_tags.hpp:202
Concepts for tensor-level objects that resolve mdspan kernel operands.