Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
tensor/conjugate_inplace.hpp
Go to the documentation of this file.
1#pragma once
2
16
17#if UNI20_BACKEND_CUDA
19#endif
20
21#include <utility>
22
23namespace uni20
24{
25
27template <class BackendSelector, MutableMdspecLike Mdspec>
28void conjugate_inplace(BackendSelector&& selector, Mdspec&& span)
29{
30 linalg::dispatch_kernel(std::forward<BackendSelector>(selector), linalg::conjugate_inplace_op{},
31 std::forward<Mdspec>(span));
32}
33
35template <class BackendSelector, MutableTensorView Tensor>
36void conjugate_inplace(BackendSelector&& selector, Tensor&& tensor)
37{
38 auto descriptor = mdspec_of(tensor);
39 linalg::dispatch_kernel(std::forward<BackendSelector>(selector), linalg::conjugate_inplace_op{}, descriptor);
40}
41
43template <MutableTensorView Tensor> void conjugate_inplace(Tensor&& tensor)
44{
45 auto operation = linalg::conjugate_inplace_op{};
46 auto selector = linalg::select_backend(operation, tensor);
47 conjugate_inplace(selector, std::forward<Tensor>(tensor));
48}
49
50} // namespace uni20
RAII leases that resolve device descriptors and tensor views to mdspans.
Ordered backend selector values shared by tensor storage and linalg dispatch.
General-purpose owning tensor with immediate or deferred mdspan metadata.
Definition basic_tensor.hpp:109
Operation-tag backend dispatch over tensor-view operands.
Reference CPU backend for in-place scalar conjugation.
CUDA reference backend for in-place scalar conjugation.
Mdspan concept and accessor extensions for Uni20.
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
Definition async/async.hpp:26
void conjugate_inplace(BackendSelector selector, async::Async< Tensor > &tensor)
Schedule eager in-place conjugation through an explicit selector.
Definition linalg/async/conjugate_inplace.hpp:44
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.
std::size_t span
Definition presentation.cpp:2017
Accessor-respecting in-place scalar conjugation operation tag.
Definition operation_tags.hpp:39
Concepts for tensor-level objects that resolve mdspan kernel operands.