Skip to content

Commit e18924a

Browse files
committed
fix: the macros of determining the device code should be reversed
1 parent cfb0b7b commit e18924a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/colvartypes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ class colvarmodule::rvector {
823823

824824
inline COLVARS_HOST_DEVICE cvm::real norm() const
825825
{
826-
#if (!defined(__HIP_DEVICE_COMPILE__)) || (!defined (__CUDA_ARCH__))
826+
#if (defined(__HIP_DEVICE_COMPILE__)) || (defined (__CUDA_ARCH__))
827827
#define COLVARS_MATH_SQRT ::sqrt
828828
#else
829829
#define COLVARS_MATH_SQRT cvm::sqrt
@@ -1082,7 +1082,7 @@ class colvarmodule::quaternion {
10821082
/// Norm of the quaternion
10831083
inline COLVARS_HOST_DEVICE cvm::real norm() const
10841084
{
1085-
#if (!defined(__HIP_DEVICE_COMPILE__)) || (!defined (__CUDA_ARCH__))
1085+
#if (defined(__HIP_DEVICE_COMPILE__)) || (defined (__CUDA_ARCH__))
10861086
#define COLVARS_MATH_SQRT ::sqrt
10871087
#else
10881088
#define COLVARS_MATH_SQRT cvm::sqrt
@@ -1276,7 +1276,7 @@ class colvarmodule::quaternion {
12761276
{
12771277
cvm::real const cos_omega = this->q0*Q2.q0 + this->q1*Q2.q1 +
12781278
this->q2*Q2.q2 + this->q3*Q2.q3;
1279-
#if (!defined(__HIP_DEVICE_COMPILE__)) || (!defined (__CUDA_ARCH__))
1279+
#if (defined(__HIP_DEVICE_COMPILE__)) || (defined (__CUDA_ARCH__))
12801280
#define COLVARS_MATH_ACOS ::acos
12811281
#else
12821282
#define COLVARS_MATH_ACOS cvm::acos
@@ -1296,7 +1296,7 @@ class colvarmodule::quaternion {
12961296
/// to that provided by slerp
12971297
inline COLVARS_HOST_DEVICE cvm::quaternion dist2_grad(cvm::quaternion const &Q2) const
12981298
{
1299-
#if (!defined(__HIP_DEVICE_COMPILE__)) || (!defined (__CUDA_ARCH__))
1299+
#if (defined(__HIP_DEVICE_COMPILE__)) || (defined (__CUDA_ARCH__))
13001300
#define COLVARS_MATH_ACOS ::acos
13011301
#define COLVARS_MATH_SIN ::sin
13021302
#define COLVARS_MATH_FABS ::fabs

0 commit comments

Comments
 (0)