37namespace nda::lapack {
57 template <MemoryMatrix A, MemoryVector IPIV>
59 int getri(A &&a, IPIV
const &ipiv) {
60 static_assert(std::is_same_v<get_value_t<IPIV>,
int>,
"Error in nda::lapack::getri: Pivoting array must have elements of type int");
61 auto dm = std::min(a.extent(0), a.extent(1));
64 NDA_RUNTIME_ERROR <<
"Error in nda::lapack::getri: Pivot index array size " << ipiv.size() <<
" smaller than required size " << dm;
67 EXPECTS(a.indexmap().min_stride() == 1);
68 EXPECTS(ipiv.indexmap().min_stride() == 1);
72#if defined(NDA_HAVE_DEVICE)
73 device::getri(a.extent(0), a.data(), get_ld(a), ipiv.data(), NULL, 0, info);
80 value_type bufferSize_T{};
81 f77::getri(a.extent(0), a.data(), get_ld(a), ipiv.data(), &bufferSize_T, -1, info);
82 int bufferSize =
static_cast<int>(std::ceil(std::real(bufferSize_T)));
86#if defined(__has_feature)
87#if __has_feature(memory_sanitizer)
91 f77::getri(a.extent(0), a.data(), get_ld(a), ipiv.data(), work.
data(), bufferSize, info);
Provides definitions and type traits involving the different memory address spaces supported by nda.
A generic multi-dimensional array.
ValueType const * data() const noexcept
Get a pointer to the actual data (in general this is not the beginning of the memory block for a view...
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
Provides a custom runtime error class and macros to assert conditions and throw exceptions.
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.
int getri(A &&a, IPIV const &ipiv)
Interface to the LAPACK getri routine.
static constexpr bool have_compatible_addr_space
Constexpr variable that is true if all given types have compatible address spaces.
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
constexpr bool is_blas_lapack_v
Alias for nda::is_double_or_complex_v.
Provides a C++ interface for various LAPACK routines.
Macros used in the nda library.
Provides type traits for the nda library.