Caffe2 - C++ API
A deep learning, cross platform ML framework
Types.cpp
1 #include <ATen/miopen/Types.h>
2 
3 #include <ATen/ATen.h>
4 #include <miopen/version.h>
5 
6 namespace at { namespace native {
7 
8 miopenDataType_t getMiopenDataType(const at::Tensor& tensor) {
9  if (tensor.scalar_type() == at::kFloat) {
10  return miopenFloat;
11  } else if (tensor.scalar_type() == at::kHalf) {
12  return miopenHalf;
13  }
14  std::string msg("getMiopenDataType() not supported for ");
15  msg += toString(tensor.scalar_type());
16  throw std::runtime_error(msg);
17 }
18 
19 int64_t miopen_version() {
20  return (MIOPEN_VERSION_MAJOR<<8) + (MIOPEN_VERSION_MINOR<<4) + MIOPEN_VERSION_PATCH;
21 }
22 
23 }} // namespace at::miopen
Flush-To-Zero and Denormals-Are-Zero mode.