BlasBackend.h 755 B

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