forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LinalgBackend.h
31 lines (24 loc) · 719 Bytes
/
LinalgBackend.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <c10/util/Exception.h>
#include <ostream>
#include <string>
namespace at {
enum class LinalgBackend : int8_t { Default, Cusolver, Magma };
inline std::string LinalgBackendToString(at::LinalgBackend backend) {
switch (backend) {
case LinalgBackend::Default:
return "at::LinalgBackend::Default";
case LinalgBackend::Cusolver:
return "at::LinalgBackend::Cusolver";
case LinalgBackend::Magma:
return "at::LinalgBackend::Magma";
default:
TORCH_CHECK(false, "Unknown linalg backend");
}
}
inline std::ostream& operator<<(
std::ostream& stream,
at::LinalgBackend backend) {
return stream << LinalgBackendToString(backend);
}
} // namespace at