TRIQS/nda 2.0.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
scal.hpp
Go to the documentation of this file.
1// Copyright (c) 2023--present, The Simons Foundation
2// This file is part of TRIQS/nda and is licensed under the Apache License, Version 2.0.
3// SPDX-License-Identifier: Apache-2.0
4// See LICENSE in the root of this distribution for details.
5
10
11#pragma once
12
14#include "./tools.hpp"
15#include "../concepts.hpp"
16#include "../device.hpp"
18#include "../traits.hpp"
19
20namespace nda::blas {
21
35 template <BlasArray<1> X>
36 void scal(get_value_t<X> alpha, X &&x) { // NOLINT (temporary views are allowed here)
38 device::scal(x.size(), alpha, x.data(), x.indexmap().strides()[0]);
39 } else {
40 f77::scal(x.size(), alpha, x.data(), x.indexmap().strides()[0]);
41 }
42 }
43
44} // namespace nda::blas
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides a C++ interface for various BLAS routines.
Provides various traits and utilities for the BLAS interface.
Provides concepts for the nda library.
Provides GPU and non-GPU specific functionality.
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.
Definition traits.hpp:212
void scal(get_value_t< X > alpha, X &&x)
Interface to the BLAS/cuBLAS scal routine.
Definition scal.hpp:36
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
Provides type traits for the nda library.