31template <KernelTypeAcceptance Value>
using KernelAcceptance = std::integral_constant<KernelTypeAcceptance, Value>;
64 return "no backend accepts these argument types";
66 return "all runtime candidates declined";
68 return "unknown dispatch failure";
85inline std::string kernel_dispatch_error_message(std::string_view operation,
KernelDispatchFailure failure)
87 return "kernel dispatch failed for operation '" + std::string(operation) +
88 "': " + std::string(kernel_dispatch_failure_name(failure));
103 [[nodiscard]] std::string
const&
operation() const noexcept {
return operation_; }
111 return backend_attempts_;
115 std::string operation_;
117 std::vector<KernelBackendAttempt> backend_attempts_;
Base class for exceptions raised through Uni20's diagnostic boundary.
Definition diagnostic_error.hpp:25
Exception carrying structured information about a failed backend walk.
Definition dispatch_error.hpp:93
std::string const & operation() const noexcept
Return the stable diagnostic operation name.
Definition dispatch_error.hpp:103
KernelDispatchFailure failure() const noexcept
Return the dispatch failure category.
Definition dispatch_error.hpp:106
std::vector< KernelBackendAttempt > const & backend_attempts() const noexcept
Return the ordered backend acceptance and attempt records.
Definition dispatch_error.hpp:109
KernelDispatchError(std::string operation, KernelDispatchFailure failure, std::vector< KernelBackendAttempt > backend_attempts)
Construct a dispatch failure from its operation and backend attempts.
Definition dispatch_error.hpp:96
Structured exception base carrying diagnostic source context.
Allocation-free runtime results for kernel backend attempts.
Definition linalg/async.hpp:28
KernelDispatchFailure
Classify why an ordered kernel-dispatch walk failed.
Definition dispatch_error.hpp:44
@ all_candidates_declined
std::integral_constant< KernelTypeAcceptance, Value > KernelAcceptance
Type-level result returned by kernel_accepts_types customizations.
Definition dispatch_error.hpp:31
constexpr KernelAcceptance< KernelTypeAcceptance::no > kernel_types_no
Report that a backend rejects the argument types.
Definition dispatch_error.hpp:34
KernelTypeAcceptance
Type-level backend eligibility for an operation and argument set.
Definition dispatch_error.hpp:24
constexpr KernelAcceptance< KernelTypeAcceptance::maybe > kernel_types_maybe
Report that runtime operand values determine backend acceptance.
Definition dispatch_error.hpp:37
constexpr KernelAcceptance< KernelTypeAcceptance::yes > kernel_types_yes
Report that a backend accepts every instance of the argument types.
Definition dispatch_error.hpp:40
Describe one backend's role in a failed dispatch walk.
Definition dispatch_error.hpp:51
KernelTypeAcceptance type_acceptance
Definition dispatch_error.hpp:53
std::string backend
Definition dispatch_error.hpp:52
std::optional< KernelAttempt > runtime_result
Definition dispatch_error.hpp:54