tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
blas1_scaled.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_LINALG_BLAS1_SCALED_HPP
4#define TETL_LINALG_BLAS1_SCALED_HPP
5
8
9namespace etl::linalg {
10
12template <typename ScalingFactor, typename ElementType, typename Extents, typename Layout, typename Accessor>
13[[nodiscard]] constexpr auto scaled(ScalingFactor alpha, mdspan<ElementType, Extents, Layout, Accessor> x)
14{
15 return mdspan{
16 x.data_handle(),
17 x.mapping(),
18 accessor_scaled{alpha, x.accessor()}
19 };
20}
21
22} // namespace etl::linalg
23
24#endif // TETL_LINALG_BLAS1_SCALED_HPP
constexpr auto scaled(ScalingFactor alpha, mdspan< ElementType, Extents, Layout, Accessor > x)
Definition blas1_scaled.hpp:13
Definition accessor_conjugate.hpp:12
Definition accessor_scaled.hpp:15
Definition mdspan.hpp:38
constexpr auto accessor() const noexcept -> accessor_type const &
Definition mdspan.hpp:195
constexpr auto mapping() const noexcept -> mapping_type const &
Definition mdspan.hpp:194
constexpr auto data_handle() const noexcept -> data_handle_type const &
Definition mdspan.hpp:193