Unverified Commit 0b57ce18 authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

[Bug] Disable cpu fp16 (#2783)

* disable cpu fp16

* spell mistakes
parent 03482f0a
...@@ -50,7 +50,7 @@ namespace aten { ...@@ -50,7 +50,7 @@ namespace aten {
typedef double DType; \ typedef double DType; \
{ __VA_ARGS__ } \ { __VA_ARGS__ } \
} else { \ } else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \ LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \ } \
} while (0) } while (0)
......
...@@ -148,14 +148,16 @@ constexpr DType Min<DType>::zero; ...@@ -148,14 +148,16 @@ constexpr DType Min<DType>::zero;
#define SWITCH_BITS(bits, DType, ...) \ #define SWITCH_BITS(bits, DType, ...) \
do { \ do { \
if ((bits) == 16 || (bits) == 32) { \ if ((bits) == 16) { \
LOG(FATAL) << "FP16 not supported on CPU"; \
} else if ((bits) == 32) { \
typedef float DType; \ typedef float DType; \
{ __VA_ARGS__ } \ { __VA_ARGS__ } \
} else if ((bits) == 64) { \ } else if ((bits) == 64) { \
typedef double DType; \ typedef double DType; \
{ __VA_ARGS__ } \ { __VA_ARGS__ } \
} else { \ } else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \ LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \ } \
} while (0) } while (0)
......
...@@ -31,7 +31,7 @@ namespace cuda { ...@@ -31,7 +31,7 @@ namespace cuda {
typedef double DType; \ typedef double DType; \
{ __VA_ARGS__ } \ { __VA_ARGS__ } \
} else { \ } else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \ LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \ } \
} while (0) } while (0)
#else // USE_FP16 #else // USE_FP16
...@@ -44,7 +44,7 @@ namespace cuda { ...@@ -44,7 +44,7 @@ namespace cuda {
typedef double DType; \ typedef double DType; \
{ __VA_ARGS__ } \ { __VA_ARGS__ } \
} else { \ } else { \
LOG(FATAL) << "Data type not renogized with bits " << bits; \ LOG(FATAL) << "Data type not recognized with bits " << bits; \
} \ } \
} while (0) } while (0)
#endif // USE_FP16 #endif // USE_FP16
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment