|
|
|
@ -206,7 +206,7 @@ double dotProduct<double>(const int n, const double* x, const double* y) {
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(PADDLE_USE_MKL) || defined(PADDLE_USE_MKLML)
|
|
|
|
|
#if defined(PADDLE_USE_MKLML)
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void vExp<float>(const int n, const float* a, float* r) {
|
|
|
|
@ -295,38 +295,6 @@ template void vAdd(const int n, const double* a, const double* b, double* r);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef PADDLE_USE_MKL
|
|
|
|
|
template <>
|
|
|
|
|
void vInvSqrt<float>(const int n, const float* a, float* r) {
|
|
|
|
|
vsInvSqrt(n, a, r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void vInvSqrt<double>(const int n, const double* a, double* r) {
|
|
|
|
|
vdInvSqrt(n, a, r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void vLog1p<float>(const int n, const float* a, float* r) {
|
|
|
|
|
vsLog1p(n, a, r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void vLog1p<double>(const int n, const double* a, double* r) {
|
|
|
|
|
vdLog1p(n, a, r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void vTanh<float>(const int n, const float* a, float* r) {
|
|
|
|
|
vsTanh(n, a, r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
void vTanh<double>(const int n, const double* a, double* r) {
|
|
|
|
|
vdTanh(n, a, r);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
DEFINE_MATRIX_BINARY_OP(vInvSqrt, b = 1.0f / std::sqrt(a));
|
|
|
|
|
template <class T>
|
|
|
|
|
void vInvSqrt(const int n, const T* a, T* r) {
|
|
|
|
@ -357,6 +325,4 @@ template void vLog1p(const int n, const double* a, double* r);
|
|
|
|
|
template void vTanh(const int n, const float* a, float* r);
|
|
|
|
|
template void vTanh(const int n, const double* a, double* r);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
} // namespace paddle
|
|
|
|
|