aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-05-02 14:56:10 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2012-05-02 14:56:52 +0200
commitb47ab113b482b752aef8201bcaa8a4a75ed59cd4 (patch)
tree2d10a9d7ed462a9370a613b7ce11b993cd5516da /Auxiliary
parent9c0bc951b82e9e60b66cd48e2f8b34bd0007c4cd (diff)
GenericFD: Provide annotation to sgn function for CUDA
Diffstat (limited to 'Auxiliary')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
index 65be7c5..6e3ed2b 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
@@ -57,7 +57,14 @@ extern "C" {
(*(CCTK_REAL const*)&((char const*)(var))[cdi*(i)+cdj*(j)+cdk*(k)])
/* Implement the signum function, used for Mathematica's Sign function */
-static inline CCTK_REAL sgn(CCTK_REAL x)
+
+#ifdef __CUDACC__
+#define KRANC_WHERE __device__
+#else
+#define KRANC_WHERE
+#endif
+
+KRANC_WHERE static inline CCTK_REAL sgn(CCTK_REAL x)
{
return x==(CCTK_REAL)0.0 ? (CCTK_REAL)0.0 : copysign((CCTK_REAL)1.0, x);
}