QUDA v0.4.0
A library for QCD on GPUs
|
00001 #ifndef _TEST_UTIL_H 00002 #define _TEST_UTIL_H 00003 00004 #include <quda.h> 00005 00006 #define gaugeSiteSize 18 // real numbers per link 00007 #define spinorSiteSize 24 // real numbers per spinor 00008 #define cloverSiteSize 72 // real numbers per block-diagonal clover matrix 00009 #define momSiteSize 10 // real numbers per momentum 00010 #define hwSiteSize 12 // real numbers per half wilson 00011 #ifdef __cplusplus 00012 extern "C" { 00013 #endif 00014 00015 int neighborIndex(int i, int oddBit, int dx4, int dx3, int dx2, int dx1); 00016 int neighborIndexFullLattice(int i, int dx4, int dx3, int dx2, int dx1) ; 00017 int neighborIndex_mg(int i, int oddBit, int dx4, int dx3, int dx2, int dx1); 00018 int neighborIndexFullLattice_mg(int i, int dx4, int dx3, int dx2, int dx1); 00019 00020 void printSpinorElement(void *spinor, int X, QudaPrecision precision); 00021 void printGaugeElement(void *gauge, int X, QudaPrecision precision); 00022 00023 int fullLatticeIndex(int i, int oddBit); 00024 int getOddBit(int X); 00025 00026 void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param); 00027 void construct_fat_long_gauge_field(void **fatlink, void** longlink, int type, QudaPrecision precision, QudaGaugeParam*); 00028 void construct_clover_field(void *clover, double norm, double diag, QudaPrecision precision); 00029 void construct_spinor_field(void *spinor, int type, int i0, int s0, int c0, QudaPrecision precision); 00030 void createSiteLinkCPU(void** link, QudaPrecision precision, int phase) ; 00031 00032 void su3_construct(void *mat, QudaReconstructType reconstruct, QudaPrecision precision); 00033 void su3_reconstruct(void *mat, int dir, int ga_idx, QudaReconstructType reconstruct, QudaPrecision precision, QudaGaugeParam *param); 00034 //void su3_construct_8_half(float *mat, short *mat_half); 00035 //void su3_reconstruct_8_half(float *mat, short *mat_half, int dir, int ga_idx, QudaGaugeParam *param); 00036 00037 void compare_spinor(void *spinor_cpu, void *spinor_gpu, int len, QudaPrecision precision); 00038 void strong_check(void *spinor, void *spinorGPU, int len, QudaPrecision precision); 00039 int compare_floats(void *a, void *b, int len, double epsilon, QudaPrecision precision); 00040 00041 void check_gauge(void **, void **, double epsilon, QudaPrecision precision); 00042 00043 int strong_check_link(void ** linkA, const char* msgA, void **linkB, const char* msgB, int len, QudaPrecision prec); 00044 int strong_check_mom(void * momA, void *momB, int len, QudaPrecision prec); 00045 00046 void createMomCPU(void* mom, QudaPrecision precision); 00047 void createHwCPU(void* hw, QudaPrecision precision); 00048 00049 //used by link fattening code 00050 int x4_from_full_index(int i); 00051 // ---------- gauge_read.cpp ---------- 00052 00053 //void readGaugeField(char *filename, float *gauge[], int argc, char *argv[]); 00054 00055 // additions for dw (quickly hacked on) 00056 int fullLatticeIndex_4d(int i, int oddBit); 00057 int fullLatticeIndex_5d(int i, int oddBit); 00058 int process_command_line_option(int argc, char** argv, int* idx); 00059 00060 #ifdef __cplusplus 00061 } 00062 #endif 00063 00064 #endif // _TEST_UTIL_H