MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
copy.hpp File Reference
#include <concepts>
#include <cstddef>
#include <cstring>
#include <functional>
#include <stdexcept>
#include <type_traits>
#include <mtl/detail/exceptions.hpp>
#include <mtl/mat/dense2D.hpp>
#include <mtl/mat/parameter.hpp>
#include <mtl/memory/memory_space.hpp>
#include <mtl/tag/storage.hpp>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/vec/parameter.hpp>

Classes

struct  mtl::detail::rebind_space< Params, Space >
 Parameters with their memory space replaced by Space, for copy_to. More...
struct  mtl::detail::rebind_space< vec::parameters< O, D, St, Sz, Sp >, Space >
struct  mtl::detail::rebind_space< mat::parameters< O, I, D, St, Sz, Sp >, Space >

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Typedefs

template<typename Storage, typename Space>
using mtl::detail::rebound_storage_t
template<typename Params, typename Space>
using mtl::detail::rebind_space_t = typename rebind_space<Params, Space>::type

Functions

template<typename T, typename H>
auto mtl::detail::transport_target (H h)
 A handle as a runtime's copy_bytes receives it: a T* as void*, any other handle as itself (#1017).
template<typename T, typename H>
auto mtl::detail::transport_source (H h)
template<typename SrcSpace, typename DstSpace, typename T>
void mtl::detail::copy_between_spaces (typename handle_traits< SrcSpace, T >::const_handle_type src, typename handle_traits< DstSpace, T >::handle_type dst, std::size_t n)
 Copy n elements of trivially copyable T between two memory spaces, through the runtime that owns the device side (see the header comment).
template<typename V, typename P1, typename P2>
requires (!vec::dense_vector<V, P2>::read_only && std::is_same_v<typename P1::orientation, typename P2::orientation>)
void mtl::copy (const vec::dense_vector< V, P1 > &src, vec::dense_vector< V, P2 > &dst)
 dst receives src's elements (#1017).
template<typename V, typename P1, typename P2>
requires (!vec::dense_vector<V, P2>::read_only && std::is_same_v<typename P1::orientation, typename P2::orientation>)
void mtl::copy (const vec::dense_vector< V, P1 > &src, vec::dense_vector< V, P2 > &&dst)
 A temporary target, such as a view built at the call site: written through.
template<typename V, typename P1, typename P2>
requires (!mat::dense2D<V, P2>::read_only && std::is_same_v<typename P1::orientation, typename P2::orientation> && std::is_same_v<typename P1::index_type, typename P2::index_type>)
void mtl::copy (const mat::dense2D< V, P1 > &src, mat::dense2D< V, P2 > &dst)
 dst receives src's elements (#1017).
template<typename V, typename P1, typename P2>
requires (!mat::dense2D<V, P2>::read_only && std::is_same_v<typename P1::orientation, typename P2::orientation> && std::is_same_v<typename P1::index_type, typename P2::index_type>)
void mtl::copy (const mat::dense2D< V, P1 > &src, mat::dense2D< V, P2 > &&dst)
 A temporary target, such as a view built at the call site: written through.
template<typename Space, typename V, typename P>
auto mtl::copy_to (const vec::dense_vector< V, P > &x)
 A new owning vector in Space holding x's elements (#1017).
template<typename Space, typename V, typename P>
auto mtl::copy_to (const mat::dense2D< V, P > &x)
 A new owning matrix in Space holding x's elements (#1017).
template<typename C>
auto mtl::to_host (const C &x) -> decltype(copy_to< memory_space::host >(x))
 A new host container holding x's elements: always a copy (#1017).