xref: /aosp_15_r20/external/pytorch/aten/src/ATen/BlasBackend.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <c10/util/Exception.h>
4 
5 #include <ostream>
6 #include <string>
7 
8 namespace at {
9 
10 enum class BlasBackend : int8_t { Cublas, Cublaslt };
11 
BlasBackendToString(at::BlasBackend backend)12 inline std::string BlasBackendToString(at::BlasBackend backend) {
13   switch (backend) {
14     case BlasBackend::Cublas:
15       return "at::BlasBackend::Cublas";
16     case BlasBackend::Cublaslt:
17       return "at::BlasBackend::Cublaslt";
18     default:
19       TORCH_CHECK(false, "Unknown blas backend");
20   }
21 }
22 
23 inline std::ostream& operator<<(std::ostream& stream, at::BlasBackend backend) {
24   return stream << BlasBackendToString(backend);
25 }
26 
27 } // namespace at
28