pytorch/c10/core/DispatchKey.cpp
Richard Zou d26f7f09b5 Fixup: rename BatchedTensorKey to Batched (#38798)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38798

This makes it more in-line with the other keys in the file
(DispatchKey.h).

Test Plan: Imported from OSS

Differential Revision: D21691789

Pulled By: zou3519

fbshipit-source-id: 8d8b902360c0238f67bd0e58f9d969cec4b63320
2020-05-28 13:47:09 -07:00

63 lines
1.6 KiB
C++

#include <c10/core/DispatchKey.h>
namespace c10 {
const char* toString(DispatchKey t) {
switch (t) {
case DispatchKey::Undefined:
return "Undefined";
case DispatchKey::CPU:
return "CPU";
case DispatchKey::CUDA:
return "CUDA";
case DispatchKey::SparseCPU:
return "SparseCPU";
case DispatchKey::SparseCUDA:
return "SparseCUDA";
case DispatchKey::MKLDNN:
return "MKLDNN";
case DispatchKey::OpenGL:
return "OpenGL";
case DispatchKey::OpenCL:
return "OpenCL";
case DispatchKey::IDEEP:
return "IDEEP";
case DispatchKey::HIP:
return "HIP";
case DispatchKey::SparseHIP:
return "SparseHIP";
case DispatchKey::MSNPU:
return "MSNPU";
case DispatchKey::XLA:
return "XLA";
case DispatchKey::Vulkan:
return "Vulkan";
case DispatchKey::MkldnnCPU:
return "MkldnnCPU";
case DispatchKey::QuantizedCPU:
return "QuantizedCPU";
case DispatchKey::Autograd:
return "Autograd";
case DispatchKey::BackendSelect:
return "BackendSelect";
case DispatchKey::Batched:
return "Batched";
case DispatchKey::TESTING_ONLY_GenericMode:
return "TESTING_ONLY_GenericMode";
case DispatchKey::Autocast:
return "Autocast";
case DispatchKey::TESTING_ONLY_GenericWrapper:
return "TESTING_ONLY_GenericWrapper";
case DispatchKey::Profiler:
return "Profile";
default:
return "UNKNOWN_TENSOR_TYPE_ID";
}
}
std::ostream& operator<<(std::ostream& str, DispatchKey rhs) {
return str << toString(rhs);
}
} // namespace c10