/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2015,2016,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2012,2015,2016,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
return make_float3(a.x, a.y, a.z);
}
-__forceinline__ __host__ __device__ float3 operator-(float3& a)
+__forceinline__ __host__ __device__ float3 operator-(const float3& a)
{
return make_float3(-a.x, -a.y, -a.z);
}
{
return make_float3(k * a.x, k * a.y, k * a.z);
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator+=(float3& a, float3 b)
{
a.x += b.x;
a.y += b.y;
a.z += b.z;
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator+=(float3& a, float4 b)
{
a.x += b.x;
a.y += b.y;
a.z += b.z;
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator-=(float3& a, float3 b)
{
a.x -= b.x;
{
return make_float3(a.x * b.x, a.y * b.y, a.z * b.z);
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator*=(float3& a, float3 b)
{
a.x *= b.x;
a.y *= b.y;
a.z *= b.z;
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator*=(float3& a, float b)
{
a.x *= b;
}
__forceinline__ __host__ __device__ float4 make_float4(float3 a)
{
- return make_float4(a.x, a.y, a.z, 0.0f);
+ return make_float4(a.x, a.y, a.z, 0.0F);
}
__forceinline__ __host__ __device__ float4 operator+(float4 a, float4 b)
{
a.z += b.z;
a.w += b.w;
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator+=(float4& a, float3 b)
{
a.x += b.x;
a.y += b.y;
a.z += b.z;
}
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __host__ __device__ void operator-=(float4& a, float3 b)
{
a.x -= b.x;
float ipb = norm2(b);
float ip = iprod(a, b);
float ipab = ipa * ipb;
- if (ipab > 0.0f)
+ if (ipab > 0.0F)
{
cosval = ip * rsqrt(ipab);
}
else
{
- cosval = 1.0f;
+ cosval = 1.0F;
}
- if (cosval > 1.0f)
+ if (cosval > 1.0F)
{
- return 1.0f;
+ return 1.0F;
}
- if (cosval < -1.0f)
+ if (cosval < -1.0F)
{
- return -1.0f;
+ return -1.0F;
}
return cosval;
*
* \param[in] a First vector.
* \param[in] b Second vector.
- * \returns Angle between vectors.
*/
+// NOLINTNEXTLINE(google-runtime-references)
__forceinline__ __device__ void atomicAdd(float3& a, const float3 b)
{
atomicAdd(&a.x, b.x);