Added missing bfloat16 (#252)

Signed-off-by: AbdelRauf <rauf@konduit.ai>
master
Abdelrauf 2020-02-18 18:01:43 +04:00 committed by GitHub
parent da39a63c9b
commit 72f9cda019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -326,6 +326,11 @@ namespace nd4j {
#endif #endif
} }
template <>
math_def FORCEINLINE bfloat16 p_floor(bfloat16 value) {
return static_cast<bfloat16>(floorf((float)value));
}
template <> template <>
math_def FORCEINLINE double p_floor(double value) { math_def FORCEINLINE double p_floor(double value) {
return floor(value); return floor(value);
@ -352,6 +357,11 @@ namespace nd4j {
#endif #endif
} }
template <>
math_def FORCEINLINE bfloat16 p_ceil(bfloat16 value) {
return static_cast<bfloat16>(ceilf((float)value));
}
template <> template <>
math_def FORCEINLINE double p_ceil(double value) { math_def FORCEINLINE double p_ceil(double value) {
return ceil(value); return ceil(value);
@ -374,6 +384,12 @@ namespace nd4j {
return static_cast<float16>(roundf((float) val)); return static_cast<float16>(roundf((float) val));
} }
template <>
math_def FORCEINLINE bfloat16 p_round(bfloat16 value) {
return static_cast<bfloat16>(roundf((float)value));
}
template <> template <>
math_def FORCEINLINE double p_round(double value) { math_def FORCEINLINE double p_round(double value) {
return round(value); return round(value);