QUDA v0.3.2
A library for QCD on GPUs
Defines

quda/lib/io_spinor.h File Reference

Go to the source code of this file.

Defines

#define READ_SPINOR_DOUBLE(spinor)
#define READ_SPINOR_DOUBLE_UP(spinor)
#define READ_SPINOR_DOUBLE_DOWN(spinor)
#define READ_SPINOR_SINGLE(spinor)
#define READ_SPINOR_SINGLE_UP(spinor)
#define READ_SPINOR_SINGLE_DOWN(spinor)
#define READ_SPINOR_HALF(spinor)
#define READ_SPINOR_HALF_UP(spinor)
#define READ_SPINOR_HALF_DOWN(spinor)
#define READ_ACCUM_DOUBLE(spinor)
#define READ_ACCUM_SINGLE(spinor)
#define READ_ACCUM_HALF(spinor)
#define WRITE_SPINOR_DOUBLE2()
#define WRITE_SPINOR_FLOAT4()
#define WRITE_SPINOR_SHORT4()
#define SHORT_LENGTH   65536
#define SCALE_FLOAT   ((SHORT_LENGTH-1) * 0.5)
#define SHIFT_FLOAT   (-1.f / (SHORT_LENGTH-1))
#define REVERSE_SCALE_FLOAT   (3.05180438e-5f)
#define short2float(a)   (a*REVERSE_SCALE_FLOAT + 1.52590219e-5f)
#define READ_1ST_NBR_SPINOR_SINGLE(spinor, idx, mystride)
#define READ_3RD_NBR_SPINOR_SINGLE(spinor, idx, mystride)
#define READ_1ST_NBR_SPINOR_DOUBLE(spinor, idx, mystride)
#define READ_3RD_NBR_SPINOR_DOUBLE(spinor, idx, mystride)
#define READ_1ST_NBR_SPINOR_HALF(spinor, idx, mystride)
#define READ_3RD_NBR_SPINOR_HALF(spinor, idx, mystride)
#define READ_ST_ACCUM_HALF(spinor)
#define WRITE_ST_SPINOR_DOUBLE2()
#define WRITE_ST_SPINOR_FLOAT2()
#define WRITE_ST_SPINOR_SHORT2()
#define READ_AND_SUM_ST_SPINOR()
#define READ_AND_SUM_ST_SPINOR_HALF()
#define READ_ST_ACCUM_SINGLE(spinor)
#define READ_ST_SPINOR_HALF(spinor)

Define Documentation

#define READ_1ST_NBR_SPINOR_DOUBLE (   spinor,
  idx,
  mystride 
)
Value:
double2 I0 = fetch_double2((spinor), idx + 0*mystride); \
  double2 I1 = fetch_double2((spinor), idx + 1*mystride);       \
  double2 I2 = fetch_double2((spinor), idx + 2*mystride);

Definition at line 237 of file io_spinor.h.

#define READ_1ST_NBR_SPINOR_HALF (   spinor,
  idx,
  mystride 
)
Value:
float2 I0 = tex1Dfetch((spinor), idx + 0*mystride);                     \
  float2 I1 = tex1Dfetch((spinor), idx + 1*mystride);                   \
  float2 I2 = tex1Dfetch((spinor), idx + 2*mystride);                   \
  {float C = tex1Dfetch((spinorTexNorm), idx);                          \
    I0.x *= C; I0.y *= C;                                               \
    I1.x *= C; I1.y *= C;                                               \
    I2.x *= C; I2.y *= C;}

Definition at line 248 of file io_spinor.h.

#define READ_1ST_NBR_SPINOR_SINGLE (   spinor,
  idx,
  mystride 
)
Value:
float2 I0 = tex1Dfetch((spinor), idx + 0*mystride);             \
  float2 I1 = tex1Dfetch((spinor), idx + 1*mystride);           \
  float2 I2 = tex1Dfetch((spinor), idx + 2*mystride);

Definition at line 227 of file io_spinor.h.

#define READ_3RD_NBR_SPINOR_DOUBLE (   spinor,
  idx,
  mystride 
)
Value:
double2 T0 = fetch_double2((spinor), idx + 0*mystride); \
  double2 T1 = fetch_double2((spinor), idx + 1*mystride);       \
  double2 T2 = fetch_double2((spinor), idx + 2*mystride);

Definition at line 242 of file io_spinor.h.

#define READ_3RD_NBR_SPINOR_HALF (   spinor,
  idx,
  mystride 
)
Value:
float2 T0 = tex1Dfetch((spinor), idx + 0*mystride);                     \
  float2 T1 = tex1Dfetch((spinor), idx + 1*mystride);                   \
  float2 T2 = tex1Dfetch((spinor), idx + 2*mystride);                   \
  {float C = tex1Dfetch((spinorTexNorm), idx);                          \
    T0.x *= C; T0.y *= C;                                               \
    T1.x *= C; T1.y *= C;                                               \
    T2.x *= C; T2.y *= C;}

Definition at line 257 of file io_spinor.h.

#define READ_3RD_NBR_SPINOR_SINGLE (   spinor,
  idx,
  mystride 
)
Value:
float2 T0 = tex1Dfetch((spinor), idx + 0*mystride);             \
  float2 T1 = tex1Dfetch((spinor), idx + 1*mystride);           \
  float2 T2 = tex1Dfetch((spinor), idx + 2*mystride);

Definition at line 232 of file io_spinor.h.

#define READ_ACCUM_DOUBLE (   spinor)
Value:
double2 accum0 = fetch_double2((spinor), sid + 0*(sp_stride));   \
  double2 accum1 = fetch_double2((spinor), sid + 1*(sp_stride));   \
  double2 accum2 = fetch_double2((spinor), sid + 2*(sp_stride));   \
  double2 accum3 = fetch_double2((spinor), sid + 3*(sp_stride));   \
  double2 accum4 = fetch_double2((spinor), sid + 4*(sp_stride));   \
  double2 accum5 = fetch_double2((spinor), sid + 5*(sp_stride));   \
  double2 accum6 = fetch_double2((spinor), sid + 6*(sp_stride));   \
  double2 accum7 = fetch_double2((spinor), sid + 7*(sp_stride));   \
  double2 accum8 = fetch_double2((spinor), sid + 8*(sp_stride));   \
  double2 accum9 = fetch_double2((spinor), sid + 9*(sp_stride));   \
  double2 accum10 = fetch_double2((spinor), sid + 10*(sp_stride)); \
  double2 accum11 = fetch_double2((spinor), sid + 11*(sp_stride));

Definition at line 82 of file io_spinor.h.

#define READ_ACCUM_HALF (   spinor)
Value:
float4 accum0 = tex1Dfetch((spinor), sid + 0*(sp_stride));       \
  float4 accum1 = tex1Dfetch((spinor), sid + 1*(sp_stride));       \
  float4 accum2 = tex1Dfetch((spinor), sid + 2*(sp_stride));       \
  float4 accum3 = tex1Dfetch((spinor), sid + 3*(sp_stride));       \
  float4 accum4 = tex1Dfetch((spinor), sid + 4*(sp_stride));       \
  float4 accum5 = tex1Dfetch((spinor), sid + 5*(sp_stride));       \
  float C = tex1Dfetch((accumTexNorm), sid);                       \
  accum0.x *= C; accum0.y *= C; accum0.z *= C; accum0.w *= C;      \
  accum1.x *= C; accum1.y *= C; accum1.z *= C; accum1.w *= C;      \
  accum2.x *= C; accum2.y *= C; accum2.z *= C; accum2.w *= C;      \
  accum3.x *= C; accum3.y *= C; accum3.z *= C; accum3.w *= C;      \
  accum4.x *= C; accum4.y *= C; accum4.z *= C; accum4.w *= C;      \
  accum5.x *= C; accum5.y *= C; accum5.z *= C; accum5.w *= C;

Definition at line 104 of file io_spinor.h.

#define READ_ACCUM_SINGLE (   spinor)
Value:
float4 accum0 = tex1Dfetch((spinor), sid + 0*(sp_stride));       \
  float4 accum1 = tex1Dfetch((spinor), sid + 1*(sp_stride));       \
  float4 accum2 = tex1Dfetch((spinor), sid + 2*(sp_stride));       \
  float4 accum3 = tex1Dfetch((spinor), sid + 3*(sp_stride));       \
  float4 accum4 = tex1Dfetch((spinor), sid + 4*(sp_stride));       \
  float4 accum5 = tex1Dfetch((spinor), sid + 5*(sp_stride));

Definition at line 96 of file io_spinor.h.

#define READ_AND_SUM_ST_SPINOR ( )
Value:
o00_re += g_out[0*sp_stride+sid].x; o00_im += g_out[0*sp_stride+sid].y; \
  o01_re += g_out[1*sp_stride+sid].x; o01_im += g_out[1*sp_stride+sid].y; \
  o02_re += g_out[2*sp_stride+sid].x; o02_im += g_out[2*sp_stride+sid].y; \

Definition at line 364 of file io_spinor.h.

#define READ_AND_SUM_ST_SPINOR_HALF ( )
Value:
float C = outNorm[sid];                         \
  o00_re += C*short2float(g_out[0*sp_stride + sid].x);  \
  o00_im += C*short2float(g_out[0*sp_stride + sid].y);  \
  o01_re += C*short2float(g_out[1*sp_stride + sid].x);  \
  o01_im += C*short2float(g_out[1*sp_stride + sid].y);  \
  o02_re += C*short2float(g_out[2*sp_stride + sid].x);  \
  o02_im += C*short2float(g_out[2*sp_stride + sid].y);

Definition at line 371 of file io_spinor.h.

#define READ_SPINOR_DOUBLE (   spinor)
Value:
double2 I0 = fetch_double2((spinor), sp_idx + 0*(sp_stride));   \
  double2 I1 = fetch_double2((spinor), sp_idx + 1*(sp_stride));   \
  double2 I2 = fetch_double2((spinor), sp_idx + 2*(sp_stride));   \
  double2 I3 = fetch_double2((spinor), sp_idx + 3*(sp_stride));   \
  double2 I4 = fetch_double2((spinor), sp_idx + 4*(sp_stride));   \
  double2 I5 = fetch_double2((spinor), sp_idx + 5*(sp_stride));   \
  double2 I6 = fetch_double2((spinor), sp_idx + 6*(sp_stride));   \
  double2 I7 = fetch_double2((spinor), sp_idx + 7*(sp_stride));   \
  double2 I8 = fetch_double2((spinor), sp_idx + 8*(sp_stride));   \
  double2 I9 = fetch_double2((spinor), sp_idx + 9*(sp_stride));   \
  double2 I10 = fetch_double2((spinor), sp_idx + 10*(sp_stride)); \
  double2 I11 = fetch_double2((spinor), sp_idx + 11*(sp_stride));

Definition at line 1 of file io_spinor.h.

#define READ_SPINOR_DOUBLE_DOWN (   spinor)
Value:
double2 I6 = fetch_double2((spinor), sp_idx + 6*(sp_stride));   \
  double2 I7 = fetch_double2((spinor), sp_idx + 7*(sp_stride));   \
  double2 I8 = fetch_double2((spinor), sp_idx + 8*(sp_stride));   \
  double2 I9 = fetch_double2((spinor), sp_idx + 9*(sp_stride));   \
  double2 I10 = fetch_double2((spinor), sp_idx + 10*(sp_stride)); \
  double2 I11 = fetch_double2((spinor), sp_idx + 11*(sp_stride));

Definition at line 23 of file io_spinor.h.

#define READ_SPINOR_DOUBLE_UP (   spinor)
Value:
double2 I0 = fetch_double2((spinor), sp_idx + 0*(sp_stride));   \
  double2 I1 = fetch_double2((spinor), sp_idx + 1*(sp_stride));   \
  double2 I2 = fetch_double2((spinor), sp_idx + 2*(sp_stride));   \
  double2 I3 = fetch_double2((spinor), sp_idx + 3*(sp_stride));   \
  double2 I4 = fetch_double2((spinor), sp_idx + 4*(sp_stride));   \
  double2 I5 = fetch_double2((spinor), sp_idx + 5*(sp_stride));

Definition at line 15 of file io_spinor.h.

#define READ_SPINOR_HALF (   spinor)
Value:
float4 I0 = tex1Dfetch((spinor), sp_idx + 0*(sp_stride));   \
  float4 I1 = tex1Dfetch((spinor), sp_idx + 1*(sp_stride));   \
  float4 I2 = tex1Dfetch((spinor), sp_idx + 2*(sp_stride));   \
  float4 I3 = tex1Dfetch((spinor), sp_idx + 3*(sp_stride));   \
  float4 I4 = tex1Dfetch((spinor), sp_idx + 4*(sp_stride));   \
  float4 I5 = tex1Dfetch((spinor), sp_idx + 5*(sp_stride));   \
  float C = tex1Dfetch((spinorTexNorm), sp_idx);              \
  I0.x *= C; I0.y *= C; I0.z *= C; I0.w *= C;                 \
  I1.x *= C; I1.y *= C; I1.z *= C; I1.w *= C;                 \
  I2.x *= C; I2.y *= C; I2.z *= C; I2.w *= C;                 \
  I3.x *= C; I3.y *= C; I3.z *= C; I3.w *= C;                 \
  I4.x *= C; I4.y *= C; I4.z *= C; I4.w *= C;                 \
  I5.x *= C; I5.y *= C; I5.z *= C; I5.w *= C;

Definition at line 49 of file io_spinor.h.

#define READ_SPINOR_HALF_DOWN (   spinor)
Value:
float4 I3 = tex1Dfetch((spinor), sp_idx + 3*(sp_stride));   \
  float4 I4 = tex1Dfetch((spinor), sp_idx + 4*(sp_stride));   \
  float4 I5 = tex1Dfetch((spinor), sp_idx + 5*(sp_stride));   \
  float C = tex1Dfetch((spinorTexNorm), sp_idx);              \
  I3.x *= C; I3.y *= C; I3.z *= C; I3.w *= C;                 \
  I4.x *= C; I4.y *= C; I4.z *= C; I4.w *= C;                 \
  I5.x *= C; I5.y *= C; I5.z *= C; I5.w *= C;

Definition at line 73 of file io_spinor.h.

#define READ_SPINOR_HALF_UP (   spinor)
Value:
float4 I0 = tex1Dfetch((spinor), sp_idx + 0*(sp_stride));   \
  float4 I1 = tex1Dfetch((spinor), sp_idx + 1*(sp_stride));   \
  float4 I2 = tex1Dfetch((spinor), sp_idx + 2*(sp_stride));   \
  float C = tex1Dfetch((spinorTexNorm), sp_idx);              \
  I0.x *= C; I0.y *= C; I0.z *= C; I0.w *= C;                 \
  I1.x *= C; I1.y *= C; I1.z *= C; I1.w *= C;                 \
  I2.x *= C; I2.y *= C; I2.z *= C; I2.w *= C;                 \

Definition at line 64 of file io_spinor.h.

#define READ_SPINOR_SINGLE (   spinor)
Value:
float4 I0 = tex1Dfetch((spinor), sp_idx + 0*(sp_stride));   \
  float4 I1 = tex1Dfetch((spinor), sp_idx + 1*(sp_stride));   \
  float4 I2 = tex1Dfetch((spinor), sp_idx + 2*(sp_stride));   \
  float4 I3 = tex1Dfetch((spinor), sp_idx + 3*(sp_stride));   \
  float4 I4 = tex1Dfetch((spinor), sp_idx + 4*(sp_stride));   \
  float4 I5 = tex1Dfetch((spinor), sp_idx + 5*(sp_stride));

Definition at line 31 of file io_spinor.h.

#define READ_SPINOR_SINGLE_DOWN (   spinor)
Value:
float4 I3 = tex1Dfetch((spinor), sp_idx + 3*(sp_stride));   \
  float4 I4 = tex1Dfetch((spinor), sp_idx + 4*(sp_stride));   \
  float4 I5 = tex1Dfetch((spinor), sp_idx + 5*(sp_stride));

Definition at line 44 of file io_spinor.h.

#define READ_SPINOR_SINGLE_UP (   spinor)
Value:
float4 I0 = tex1Dfetch((spinor), sp_idx + 0*(sp_stride));   \
  float4 I1 = tex1Dfetch((spinor), sp_idx + 1*(sp_stride));   \
  float4 I2 = tex1Dfetch((spinor), sp_idx + 2*(sp_stride));   \

Definition at line 39 of file io_spinor.h.

#define READ_ST_ACCUM_HALF (   spinor)
Value:
float2 accum0 = tex1Dfetch((spinor), sid + 0*sp_stride);        \
  float2 accum1 = tex1Dfetch((spinor), sid + 1*sp_stride);      \
  float2 accum2 = tex1Dfetch((spinor), sid + 2*sp_stride);      \
  float C = tex1Dfetch((accumTexNorm), sid);                    \
  accum0.x *= C; accum0.y *= C;                                 \
  accum1.x *= C; accum1.y *= C;                                 \
  accum2.x *= C; accum2.y *= C;

Definition at line 267 of file io_spinor.h.

#define READ_ST_ACCUM_SINGLE (   spinor)
Value:
float2 accum0 = tex1Dfetch((spinor), sid + 0*sp_stride);        \
  float2 accum1 = tex1Dfetch((spinor), sid + 1*sp_stride);      \
  float2 accum2 = tex1Dfetch((spinor), sid + 2*sp_stride);

Definition at line 380 of file io_spinor.h.

#define READ_ST_SPINOR_HALF (   spinor)
Value:
float2 I0 = tex1Dfetch((spinor), sp_idx + 0*sp_stride); \
  float2 I1 = tex1Dfetch((spinor), sp_idx + 1*sp_stride);       \
  float2 I2 = tex1Dfetch((spinor), sp_idx + 2*sp_stride);       \
  float C = tex1Dfetch((spinorTexNorm), sp_idx);                \
  I0.x *= C; I0.y *= C;                                         \
  I1.x *= C; I1.y *= C;                                         \
  I2.x *= C; I2.y *= C;

Definition at line 385 of file io_spinor.h.

#define REVERSE_SCALE_FLOAT   (3.05180438e-5f)

Definition at line 220 of file io_spinor.h.

#define SCALE_FLOAT   ((SHORT_LENGTH-1) * 0.5)

Definition at line 218 of file io_spinor.h.

#define SHIFT_FLOAT   (-1.f / (SHORT_LENGTH-1))

Definition at line 219 of file io_spinor.h.

#define short2float (   a)    (a*REVERSE_SCALE_FLOAT + 1.52590219e-5f)

Definition at line 222 of file io_spinor.h.

#define SHORT_LENGTH   65536

Definition at line 217 of file io_spinor.h.

#define WRITE_SPINOR_DOUBLE2 ( )
Value:
out[0*(sp_stride)+sid] = make_double2(o00_re, o00_im);     \
  out[1*(sp_stride)+sid] = make_double2(o01_re, o01_im);           \
  out[2*(sp_stride)+sid] = make_double2(o02_re, o02_im);           \
  out[3*(sp_stride)+sid] = make_double2(o10_re, o10_im);           \
  out[4*(sp_stride)+sid] = make_double2(o11_re, o11_im);           \
  out[5*(sp_stride)+sid] = make_double2(o12_re, o12_im);           \
  out[6*(sp_stride)+sid] = make_double2(o20_re, o20_im);           \
  out[7*(sp_stride)+sid] = make_double2(o21_re, o21_im);           \
  out[8*(sp_stride)+sid] = make_double2(o22_re, o22_im);           \
  out[9*(sp_stride)+sid] = make_double2(o30_re, o30_im);           \
  out[10*(sp_stride)+sid] = make_double2(o31_re, o31_im);          \
  out[11*(sp_stride)+sid] = make_double2(o32_re, o32_im);

Definition at line 120 of file io_spinor.h.

#define WRITE_SPINOR_FLOAT4 ( )
Value:
out[0*(sp_stride)+sid] = make_float4(o00_re, o00_im, o01_re, o01_im); \
  out[1*(sp_stride)+sid] = make_float4(o02_re, o02_im, o10_re, o10_im); \
  out[2*(sp_stride)+sid] = make_float4(o11_re, o11_im, o12_re, o12_im); \
  out[3*(sp_stride)+sid] = make_float4(o20_re, o20_im, o21_re, o21_im); \
  out[4*(sp_stride)+sid] = make_float4(o22_re, o22_im, o30_re, o30_im); \
  out[5*(sp_stride)+sid] = make_float4(o31_re, o31_im, o32_re, o32_im);

Definition at line 134 of file io_spinor.h.

#define WRITE_SPINOR_SHORT4 ( )

Definition at line 142 of file io_spinor.h.

#define WRITE_ST_SPINOR_DOUBLE2 ( )
Value:
g_out[0*sp_stride+sid] = make_double2(o00_re, o00_im);  \
  g_out[1*sp_stride+sid] = make_double2(o01_re, o01_im);        \
  g_out[2*sp_stride+sid] = make_double2(o02_re, o02_im);

Definition at line 340 of file io_spinor.h.

#define WRITE_ST_SPINOR_FLOAT2 ( )
Value:
g_out[0*sp_stride+sid] = make_float2(o00_re, o00_im);   \
  g_out[1*sp_stride+sid] = make_float2(o01_re, o01_im); \
  g_out[2*sp_stride+sid] = make_float2(o02_re, o02_im);

Definition at line 345 of file io_spinor.h.

#define WRITE_ST_SPINOR_SHORT2 ( )
Value:
float c0 = fmaxf(fabsf(o00_re), fabsf(o00_im));                 \
  float c1 = fmaxf(fabsf(o01_re), fabsf(o01_im));                       \
  float c2 = fmaxf(fabsf(o02_re), fabsf(o02_im));                       \
  c0 = fmaxf(c0, c1);                                                   \
  c0 = fmaxf(c0, c2);                                                   \
  outNorm[sid] = c0;                                                    \
  float scale = __fdividef(MAX_SHORT, c0);                              \
  o00_re *= scale; o00_im *= scale; o01_re *= scale; o01_im *= scale;   \
  o02_re *= scale; o02_im *= scale;                                     \
  g_out[sid+0*sp_stride] = make_short2((short)o00_re, (short)o00_im);   \
  g_out[sid+1*sp_stride] = make_short2((short)o01_re, (short)o01_im);   \
  g_out[sid+2*sp_stride] = make_short2((short)o02_re, (short)o02_im);

Definition at line 350 of file io_spinor.h.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines