Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
kernel_attempt.hpp
Go to the documentation of this file.
1#pragma once
2
9#include <string_view>
10
11namespace uni20::linalg
12{
13
38
40constexpr bool kernel_attempt_succeeded(KernelAttempt attempt) noexcept { return attempt == KernelAttempt::success; }
41
43constexpr std::string_view kernel_attempt_name(KernelAttempt attempt) noexcept
44{
45 switch (attempt)
46 {
48 return "success";
50 return "unsupported runtime instance";
52 return "unsupported shape";
54 return "unsupported layout";
56 return "unsupported accessor";
58 return "unsupported transform";
60 return "incompatible devices";
62 return "unavailable";
64 return "insufficient resources";
65 }
66 return "unknown kernel attempt";
67}
68
69} // namespace uni20::linalg
Definition linalg/async.hpp:28
constexpr bool kernel_attempt_succeeded(KernelAttempt attempt) noexcept
Return whether a backend performed the operation.
Definition kernel_attempt.hpp:40
KernelAttempt
Result of one runtime kernel backend attempt.
Definition kernel_attempt.hpp:27
constexpr std::string_view kernel_attempt_name(KernelAttempt attempt) noexcept
Return a stable human-readable kernel-attempt result name.
Definition kernel_attempt.hpp:43