14 __host__ __device__
inline double2
operator+(
const double2 &x,
const double2 &y)
16 return make_double2(x.x + y.x, x.y + y.y);
19 __host__ __device__
inline double2
operator-(
const double2 &x,
const double2 &y)
21 return make_double2(x.x - y.x, x.y - y.y);
24 __host__ __device__
inline float2
operator-(
const float2 &x,
const float2 &y)
26 return make_float2(x.x - y.x, x.y - y.y);
29 __host__ __device__
inline float4
operator-(
const float4 &x,
const float4 &y)
31 return make_float4(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
42 __host__ __device__
inline double3
operator+(
const double3 &x,
const double3 &y)
44 return make_double3(x.x + y.x, x.y + y.y, x.z + y.z);
47 __host__ __device__
inline double4
operator+(
const double4 &x,
const double4 &y)
49 return make_double4(x.x + y.x, x.y + y.y, x.z + y.z, x.w + y.w);
52 __host__ __device__
inline float4
operator*(
const float &a,
const float4 &x)
62 __host__ __device__
inline float2
operator*(
const float &a,
const float2 &x)
70 __host__ __device__
inline double2
operator*(
const double &a,
const double2 &x)
78 __host__ __device__
inline double4
operator*(
const double &a,
const double4 &x)
96 __host__ __device__
inline float2
operator+(
const float2 &x,
const float2 &y)
104 __host__ __device__
inline float4
operator+(
const float4 &x,
const float4 &y)
122 __host__ __device__
inline float4
operator+=(float4 &x,
const float4 &y)
131 __host__ __device__
inline float2
operator+=(float2 &x,
const float2 &y)
145 __host__ __device__
inline double2
operator+=(double2 &x,
const double2 &y)
152 __host__ __device__
inline double3
operator+=(double3 &x,
const double3 &y)
160 __host__ __device__
inline double4
operator+=(double4 &x,
const double4 &y)
169 __host__ __device__
inline float4
operator-=(float4 &x,
const float4 &y)
178 __host__ __device__
inline float2
operator-=(float2 &x,
const float2 &y)
192 __host__ __device__
inline double2
operator-=(double2 &x,
const double2 &y)
199 __host__ __device__
inline float2
operator*=(float2 &x,
const float &a)
206 __host__ __device__
inline double2
operator*=(double2 &x,
const float &a)
213 __host__ __device__
inline float4
operator*=(float4 &a,
const float &b) {
228 __host__ __device__
inline double2
operator*=(double2 &a,
const double &b) {
234 __host__ __device__
inline double4
operator*=(double4 &a,
const double &b) {
242 __host__ __device__
inline float2
operator-(
const float2 &x) {
243 return make_float2(-x.x, -x.y);
246 __host__ __device__
inline double2
operator-(
const double2 &x) {
247 return make_double2(-x.x, -x.y);
298 #ifndef __CUDACC_RTC__
299 inline std::ostream &
operator<<(std::ostream &output,
const double2 &a)
301 output <<
"(" << a.x <<
", " << a.y <<
")";
305 inline std::ostream &
operator<<(std::ostream &output,
const double3 &a)
307 output <<
"(" << a.x <<
", " << a.y <<
"," << a.z <<
")";
311 inline std::ostream &
operator<<(std::ostream &output,
const double4 &a)
313 output <<
"(" << a.x <<
", " << a.y <<
", " << a.z <<
", " << a.w <<
")";
318 __device__ __host__
inline void zero(
double &a) { a = 0.0; }
319 __device__ __host__
inline void zero(double2 &a)
324 __device__ __host__
inline void zero(double3 &a)
330 __device__ __host__
inline void zero(double4 &a)
338 __device__ __host__
inline void zero(
float &a) { a = 0.0; }
339 __device__ __host__
inline void zero(float2 &a)
344 __device__ __host__
inline void zero(float3 &a)
350 __device__ __host__
inline void zero(float4 &a)
358 __device__ __host__
inline void zero(
short &a) { a = 0; }
359 __device__ __host__
inline void zero(
char &a) { a = 0; }
387 __device__ __host__
inline static constexpr
int size() {
return n; }
391 for (
int i = 0; i < n; i++)
data[i] += a[i];
396 for (
int i = 0; i < n; i++)
zero(
data[i]);
403 for (
int i = 0; i < n - 1; i++) output << a[i] <<
", ";
404 output << a[n - 1] <<
" }";
411 for (
int i = 0; i < n; i++)
zero(v.
data[i]);
414 template <
typename scalar,
int n>
420 for (
int i = 0; i < n; i++) c[i] = a[i] + b[i];
__host__ __device__ float4 operator+=(float4 &x, const float4 &y)
__device__ __host__ ColorSpinor< Float, Nc, Ns > operator*(const S &a, const ColorSpinor< Float, Nc, Ns > &x)
Compute the scalar-vector product y = a * x.
__device__ __host__ void zero(double &a)
__host__ __device__ float2 operator*=(float2 &x, const float &a)
__host__ __device__ float4 operator-=(float4 &x, const float4 &y)
__device__ __host__ ColorSpinor< Float, Nc, Ns > operator+(const ColorSpinor< Float, Nc, Ns > &x, const ColorSpinor< Float, Nc, Ns > &y)
ColorSpinor addition operator.
__device__ __host__ ColorSpinor< Float, Nc, Ns > operator-(const ColorSpinor< Float, Nc, Ns > &x, const ColorSpinor< Float, Nc, Ns > &y)
ColorSpinor subtraction operator.
std::ostream & operator<<(std::ostream &output, const CloverFieldParam ¶m)
__device__ static constexpr __host__ int size()
__device__ __host__ scalar & operator[](int i)
__device__ __host__ vector_type()
__device__ __host__ const scalar & operator[](int i) const
__device__ __host__ void operator+=(const vector_type &a)