summaryrefslogtreecommitdiff
path: root/c10
diff options
context:
space:
mode:
authorbddppq <bai@in.tum.de>2018-12-13 15:41:55 -0800
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-12-13 15:43:57 -0800
commitde0784510d06504d0825112e003370070ecdcd7d (patch)
treeee77102656c4344b10382c53a949c44b384d94f4 /c10
parent855d9e1f19d69e5b3963a2ec7ac3cf0fc31120d9 (diff)
downloadpytorch-de0784510d06504d0825112e003370070ecdcd7d.tar.gz
pytorch-de0784510d06504d0825112e003370070ecdcd7d.tar.bz2
pytorch-de0784510d06504d0825112e003370070ecdcd7d.zip
Remove disabled_features in hipify
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/15098 Reviewed By: ezyang Differential Revision: D13453762 Pulled By: bddppq fbshipit-source-id: e177042c78f5bf393163d660c25b80285353853d
Diffstat (limited to 'c10')
-rw-r--r--c10/cuda/CUDAMathCompat.h47
1 files changed, 41 insertions, 6 deletions
diff --git a/c10/cuda/CUDAMathCompat.h b/c10/cuda/CUDAMathCompat.h
index 35176e729e..63565150e6 100644
--- a/c10/cuda/CUDAMathCompat.h
+++ b/c10/cuda/CUDAMathCompat.h
@@ -22,33 +22,68 @@ namespace cuda {
namespace compat {
__MATH_FUNCTIONS_DECL__ float abs(float x) {
- return fabsf(x);
+ return ::fabsf(x);
}
__MATH_FUNCTIONS_DECL__ double abs(double x) {
- return fabs(x);
+ return ::fabs(x);
+}
+
+__MATH_FUNCTIONS_DECL__ float exp(float x) {
+ return ::expf(x);
+}
+__MATH_FUNCTIONS_DECL__ double exp(double x) {
+ return ::exp(x);
+}
+
+__MATH_FUNCTIONS_DECL__ float floor(float x) {
+ return ::floorf(x);
+}
+__MATH_FUNCTIONS_DECL__ double floor(double x) {
+ return ::floor(x);
+}
+
+__MATH_FUNCTIONS_DECL__ float log(float x) {
+ return ::logf(x);
+}
+__MATH_FUNCTIONS_DECL__ double log(double x) {
+ return ::log(x);
}
__MATH_FUNCTIONS_DECL__ float max(float x, float y) {
- return fmaxf(x, y);
+ return ::fmaxf(x, y);
}
__MATH_FUNCTIONS_DECL__ double max(double x, double y) {
- return fmax(x, y);
+ return ::fmax(x, y);
}
__MATH_FUNCTIONS_DECL__ float pow(float x, float y) {
- return powf(x, y);
+ return ::powf(x, y);
}
__MATH_FUNCTIONS_DECL__ double pow(double x, double y) {
return ::pow(x, y);
}
__MATH_FUNCTIONS_DECL__ void sincos(float x, float* sptr, float* cptr) {
- return sincosf(x, sptr, cptr);
+ return ::sincosf(x, sptr, cptr);
}
__MATH_FUNCTIONS_DECL__ void sincos(double x, double* sptr, double* cptr) {
return ::sincos(x, sptr, cptr);
}
+__MATH_FUNCTIONS_DECL__ float sqrt(float x) {
+ return ::sqrtf(x);
+}
+__MATH_FUNCTIONS_DECL__ double sqrt(double x) {
+ return ::sqrt(x);
+}
+
+__MATH_FUNCTIONS_DECL__ float tan(float x) {
+ return ::tanf(x);
+}
+__MATH_FUNCTIONS_DECL__ double tan(double x) {
+ return ::tan(x);
+}
+
} // namespace compat
} // namespace cuda
} // namespace c10