11 __host__ __device__
inline double2
operator+(
const double2&
x,
const double2 &y) {
12 return make_double2(x.x + y.x, x.y + y.y);
15 __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 float2
operator-(
const float2&
x,
const float2 &y) {
20 return make_float2(x.x - y.x, x.y - y.y);
23 __host__ __device__
inline float4
operator-(
const float4&
x,
const float4 &y) {
24 return make_float4(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
27 __host__
inline double3
operator+(
const double3&
x,
const double3 &y) {
29 z.x = x.x + y.x; z.y = x.y + y.y; z.z = x.z + y.z;
33 __device__
inline float4
operator*(
const float a,
const float4
x) {
42 __device__
inline float2
operator*(
const float a,
const float2
x) {
49 __device__
inline double2
operator*(
const double a,
const double2
x) {
56 __device__
inline double4
operator*(
const double a,
const double4
x) {
65 __device__
inline float2
operator+(
const float2
x,
const float2 y) {
72 __device__
inline float4
operator+(
const float4
x,
const float4 y) {
81 __device__
inline float4
operator+=(float4 &
x,
const float4 y) {
89 __device__
inline float2
operator+=(float2 &
x,
const float2 y) {
95 __host__ __device__
inline double2
operator+=(double2 &
x,
const double2 y) {
101 __host__ __device__
inline double3
operator+=(double3 &
x,
const double3 y) {
122 __device__
inline double2
operator-=(double2 &
x,
const double2 y) {
134 __device__
inline float4
operator*=(float4 &a,
const float &b) {
142 __device__
inline double2
operator*=(double2 &a,
const float &b) {
148 __device__
inline double4
operator*=(double4 &a,
const float &b) {
157 return make_float2(-x.x, -x.y);
161 return make_double2(-x.x, -x.y);
169 __forceinline__ __device__
float max_fabs(
const float4 &c) {
170 float a = fmaxf(fabsf(c.x), fabsf(c.y));
171 float b = fmaxf(fabsf(c.z), fabsf(c.w));
175 __forceinline__ __device__
float max_fabs(
const float2 &b) {
176 return fmaxf(fabsf(b.x), fabsf(b.y));
179 __forceinline__ __device__
double max_fabs(
const double4 &c) {
180 double a = fmaxf(fabsf(c.x), fabsf(c.y));
181 double b = fmaxf(fabsf(c.z), fabsf(c.w));
185 __forceinline__ __device__
double max_fabs(
const double2 &b) {
186 return fmaxf(fabsf(b.x), fabsf(b.y));
194 return make_float2(a.x, a.y);
198 return make_float4(a.x, a.y, a.z, a.w);
202 return make_double2(a.x, a.y);
206 return make_double4(a.x, a.y, a.z, a.w);
210 return make_short4(a.x, a.y, a.z, a.w);
214 return make_short2(a.x, a.y);
218 return make_short4(a.x, a.y, a.z, a.w);
222 return make_short2(a.x, a.y);