26namespace nda::tensor {
67 template <BlasArrayOrConj A, BlasArrayOrConjFor<A> B>
68 get_value_t<A> dot(A
const &a, std::string_view idx_a, B
const &b, std::string_view idx_b) {
71 static_assert(!run_on_device ||
have_cutensor,
"nda::tensor::dot: cuTENSOR support is required");
75 if constexpr (run_on_device) {
80 return tblis::dot(a, idx_a, b, idx_b);
88 template <BlasArrayOrConj A, BlasArrayOrConjFor<A, get_rank<A>> B>
91 return dot(a, idx, b, idx);
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides various algorithms to be used with nda::Array objects.
Provides the generic class for arrays.
A generic multi-dimensional array.
Provides a C++ interface for various cuTENSOR routines.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
auto sum(A const &a)
Sum all the elements of an nda::Array object.
constexpr auto hadamard(A &&a, B &&b)
Hadamard product of two nda::Array objects.
auto zeros(std::array< Int, Rank > const &shape)
Make an array of the given shape on the given address space and zero-initialize it.
decltype(auto) to_host(A &&a)
Convert an nda::MemoryArray to its regular type on host memory.
constexpr int get_rank
Constexpr variable that specifies the rank of an nda::Array or of a contiguous 1-dimensional range.
std::decay_t< decltype(get_first_element(std::declval< A const >()))> get_value_t
Get the value type of an array/view or a scalar type.
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
heap_basic< mem::mallocator< AdrSp > > heap
Alias template of the nda::heap_basic policy using an nda::mem::mallocator.
get_value_t< A > dot(A const &a, std::string_view idx_a, B const &b, std::string_view idx_b)
Full tensor dot product with cuTENSOR/TBLIS/nda dispatch.
static constexpr bool have_tblis
Constexpr variable that is true if nda is configured with TBLIS support.
static constexpr bool have_cutensor
Constexpr variable that is true if nda is configured cuTENSOR support.
void require_equal_indices(std::string_view idx_a, std::string_view idx_b, int rank, std::string_view op_name)
Check if two index strings are equal and have a specified length.
std::string_view default_index()
Generate a default index string ("abc...") of a given length.
Provides definitions of various layout policies.
Defines various memory handling policies.
Contiguous layout policy with C-order (row-major order).
Provides a C++ interface for various TBLIS tensor routines.
Provides type traits for the nda library.