QUDA v0.4.0
A library for QCD on GPUs
|
00001 #ifndef _HISQ_FORCE_UTILS_H 00002 #define _HISQ_FORCE_UTILS_H 00003 00004 #include <quda_internal.h> 00005 #include <quda.h> 00006 00007 00008 // The following routines are used to test the force calculation from hisq smearing 00009 namespace hisq{ 00010 namespace fermion_force{ 00011 00012 typedef struct { 00013 size_t bytes; 00014 QudaPrecision precision; 00015 int length; // total length 00016 int volume; // geometric volume (single parity) 00017 int X[4]; // the geometric lengths (single parity) 00018 int Nc; // length of color dimension 00019 void *data; // either (double2*) or (float2*) or (float4*) 00020 } ParityMatrix; 00021 00022 typedef struct { 00023 ParityMatrix odd; 00024 ParityMatrix even; 00025 } FullMatrix; 00026 00027 typedef struct { 00028 ParityMatrix odd; 00029 ParityMatrix even; 00030 } FullCompMatrix; // compressed matrix 00031 00032 00033 FullMatrix createMatQuda(const int X[4], QudaPrecision precision); 00034 FullCompMatrix createCompMatQuda(const int X[4], QudaPrecision precision); 00035 void freeMatQuda(FullMatrix mat); 00036 void freeCompMatQuda(FullCompMatrix mat); 00037 00038 00039 typedef struct { 00040 size_t bytes; 00041 QudaPrecision precision; 00042 int length; // total length 00043 int volume; // geometric volume 00044 int X[4]; 00045 int Nc; // length of color dimension 00046 void *data[8]; // array of 8 pointers (Not a pointer to an array!) 00047 } ParityOprod; 00048 00049 00050 typedef struct { 00051 ParityOprod odd; 00052 ParityOprod even; 00053 } FullOprod; 00054 00055 00056 void loadOprodToGPU(void *cudaOprodEven, void *cudaOprodOdd, void *cpuOprod, int vol); 00057 void allocateOprodFields(void **cudaOprodEven, void **cudaOprodOdd, int vol); 00058 void fetchOprodFromGPU(void *cudaOprodEven, void *cudaOprodOdd, void *cpuOprod, int vol); 00059 00060 FullOprod createOprodQuda(int *X, QudaPrecision precision); 00061 void copyOprodToGPU(FullOprod cudaOprod, void *oprod, int half_volume); 00062 00063 00064 } // namespace fermion_force 00065 } // namespace hisq 00066 00067 00068 #endif // _HISQ_FORCE_UTILS_H