Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
src
uni20
linalg
kernel_attempt.hpp
Go to the documentation of this file.
1
#pragma once
2
9
#include <string_view>
10
11
namespace
uni20::linalg
12
{
13
26
enum class
KernelAttempt
27
{
28
success
,
29
unsupported_instance
,
30
unsupported_shape
,
31
unsupported_layout
,
32
unsupported_accessor
,
33
unsupported_transform
,
34
incompatible_devices
,
35
unavailable
,
36
insufficient_resources
37
};
38
40
constexpr
bool
kernel_attempt_succeeded
(
KernelAttempt
attempt)
noexcept
{
return
attempt ==
KernelAttempt::success
; }
41
43
constexpr
std::string_view
kernel_attempt_name
(
KernelAttempt
attempt)
noexcept
44
{
45
switch
(attempt)
46
{
47
case
KernelAttempt::success
:
48
return
"success"
;
49
case
KernelAttempt::unsupported_instance
:
50
return
"unsupported runtime instance"
;
51
case
KernelAttempt::unsupported_shape
:
52
return
"unsupported shape"
;
53
case
KernelAttempt::unsupported_layout
:
54
return
"unsupported layout"
;
55
case
KernelAttempt::unsupported_accessor
:
56
return
"unsupported accessor"
;
57
case
KernelAttempt::unsupported_transform
:
58
return
"unsupported transform"
;
59
case
KernelAttempt::incompatible_devices
:
60
return
"incompatible devices"
;
61
case
KernelAttempt::unavailable
:
62
return
"unavailable"
;
63
case
KernelAttempt::insufficient_resources
:
64
return
"insufficient resources"
;
65
}
66
return
"unknown kernel attempt"
;
67
}
68
69
}
// namespace uni20::linalg
uni20::linalg
Definition
linalg/async.hpp:28
uni20::linalg::kernel_attempt_succeeded
constexpr bool kernel_attempt_succeeded(KernelAttempt attempt) noexcept
Return whether a backend performed the operation.
Definition
kernel_attempt.hpp:40
uni20::linalg::KernelAttempt
KernelAttempt
Result of one runtime kernel backend attempt.
Definition
kernel_attempt.hpp:27
uni20::linalg::KernelAttempt::unsupported_transform
@ unsupported_transform
uni20::linalg::KernelAttempt::unsupported_accessor
@ unsupported_accessor
uni20::linalg::KernelAttempt::success
@ success
uni20::linalg::KernelAttempt::insufficient_resources
@ insufficient_resources
uni20::linalg::KernelAttempt::unsupported_layout
@ unsupported_layout
uni20::linalg::KernelAttempt::incompatible_devices
@ incompatible_devices
uni20::linalg::KernelAttempt::unavailable
@ unavailable
uni20::linalg::KernelAttempt::unsupported_instance
@ unsupported_instance
uni20::linalg::KernelAttempt::unsupported_shape
@ unsupported_shape
uni20::linalg::kernel_attempt_name
constexpr std::string_view kernel_attempt_name(KernelAttempt attempt) noexcept
Return a stable human-readable kernel-attempt result name.
Definition
kernel_attempt.hpp:43
Generated by
1.9.8