Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
lapack_error.hpp
Go to the documentation of this file.
1#pragma once
2
10#include <uni20/config.hpp>
11
12#include <string>
13#include <string_view>
14#include <utility>
15
16namespace uni20::lapack
17{
18
19namespace detail
20{
21inline std::string lapack_error_message(std::string_view routine, std::string_view reason, blas_int info)
22{
23 return "LAPACK " + std::string(routine) + " " + std::string(reason) + " (INFO=" + std::to_string(info) + ")";
24}
25} // namespace detail
26
29 public:
31 LapackError(std::string routine, blas_int info, std::string reason)
32 : diagnostic_error(detail::lapack_error_message(routine, reason, info)), routine_(std::move(routine)),
33 info_(info), reason_(std::move(reason))
34 {}
35
37 [[nodiscard]] std::string const& routine() const noexcept { return routine_; }
38
40 [[nodiscard]] blas_int info() const noexcept { return info_; }
41
43 [[nodiscard]] std::string const& reason() const noexcept { return reason_; }
44
45 private:
46 std::string routine_;
47 blas_int info_;
48 std::string reason_;
49};
50
51} // namespace uni20::lapack
Base class for exceptions raised through Uni20's diagnostic boundary.
Definition diagnostic_error.hpp:25
Exception carrying a terminal positive LAPACK INFO result.
Definition lapack_error.hpp:28
std::string const & reason() const noexcept
Return Uni20's interpretation of the provider failure.
Definition lapack_error.hpp:43
std::string const & routine() const noexcept
Return the LAPACK routine name without a scalar prefix.
Definition lapack_error.hpp:37
LapackError(std::string routine, blas_int info, std::string reason)
Construct an error from the provider routine, status, and interpreted reason.
Definition lapack_error.hpp:31
blas_int info() const noexcept
Return the positive provider INFO value.
Definition lapack_error.hpp:40
Structured exception base carrying diagnostic source context.
Definition qnum.hpp:403
Definition backend/lapack/common.hpp:12