|
QUDA v0.3.2
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 00018 void printSpinorElement(void *spinor, int X, QudaPrecision precision); 00019 void printGaugeElement(void *gauge, int X, QudaPrecision precision); 00020 00021 int fullLatticeIndex(int i, int oddBit); 00022 int getOddBit(int X); 00023 00024 void construct_gauge_field(void **gauge, int type, QudaPrecision precision, QudaGaugeParam *param); 00025 void construct_fat_long_gauge_field(void **fatlink, void** longlink, int type, QudaPrecision precision, QudaGaugeParam*); 00026 void construct_clover_field(void *clover, double norm, double diag, QudaPrecision precision); 00027 void construct_spinor_field(void *spinor, int type, int i0, int s0, int c0, QudaPrecision precision); 00028 void createSiteLinkCPU(void* link, QudaPrecision precision, int phase) ; 00029 00030 void su3_construct(void *mat, QudaReconstructType reconstruct, QudaPrecision precision); 00031 void su3_reconstruct(void *mat, int dir, int ga_idx, QudaReconstructType reconstruct, QudaPrecision precision, QudaGaugeParam *param); 00032 //void su3_construct_8_half(float *mat, short *mat_half); 00033 //void su3_reconstruct_8_half(float *mat, short *mat_half, int dir, int ga_idx, QudaGaugeParam *param); 00034 00035 void compare_spinor(void *spinor_cpu, void *spinor_gpu, int len, QudaPrecision precision); 00036 void strong_check(void *spinor, void *spinorGPU, int len, QudaPrecision precision); 00037 int compare_floats(void *a, void *b, int len, double epsilon, QudaPrecision precision); 00038 00039 void check_gauge(void **, void **, double epsilon, QudaPrecision precision); 00040 00041 void strong_check_link(void * linkA, void *linkB, int len, QudaPrecision prec); 00042 void strong_check_mom(void * momA, void *momB, int len, QudaPrecision prec); 00043 00044 void createMomCPU(void* mom, QudaPrecision precision); 00045 void createHwCPU(void* hw, QudaPrecision precision); 00046 00047 // ---------- gauge_read.cpp ---------- 00048 00049 //void readGaugeField(char *filename, float *gauge[], int argc, char *argv[]); 00050 00051 // additions for dw (quickly hacked on) 00052 int fullLatticeIndex_4d(int i, int oddBit); 00053 int fullLatticeIndex_5d(int i, int oddBit); 00054 00055 00056 #ifdef __cplusplus 00057 } 00058 #endif 00059 00060 #endif // _TEST_UTIL_H
1.7.3