Advanced Computing Platform for Theoretical Physics

commit大文件会使得服务器变得不稳定,请大家尽量只commit代码,不要commit大的文件。

Commit 37c1415f authored by rbabich's avatar rbabich
Browse files

quda: eliminated global invert_param


git-svn-id: http://lattice.bu.edu/qcdalg/cuda/quda@584 be54200a-260c-0410-bdd7-ce6af2a381ab
parent a90f5547
......@@ -19,7 +19,6 @@ extern "C" {
extern FullClover cudaCloverInvSloppy;
extern QudaGaugeParam *gauge_param;
extern QudaInvertParam *invert_param;
// ---------- dslash_quda.cu ----------
......
......@@ -327,7 +327,7 @@ void loadCloverField(FullClover ret, void *clover, Precision cpu_prec, CloverFie
}
/*
void createCloverField(FullClover *cudaClover, void *cpuClover, int *X, Precision precision)
void createCloverField(FullClover *cudaClover, void *cpuClover, int *X, Precision precision, QudaInvertParam invert_param)
{
if (invert_param->clover_cpu_prec == QUDA_HALF_PRECISION) {
printf("QUDA error: half precision not supported on cpu\n");
......
......@@ -8,7 +8,6 @@
#include<dslash_constants.h>
QudaGaugeParam *gauge_param;
QudaInvertParam *invert_param;
unsigned long long dslash_quda_flops;
unsigned long long dslash_quda_bytes;
......
......@@ -328,8 +328,6 @@ void MatQuda(void *h_out, void *h_in, QudaInvertParam *inv_param, int dagger)
void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
{
invert_param = param;
checkInvertParam(param);
checkPrecision(param->cpu_prec);
......@@ -348,13 +346,13 @@ void invertQuda(void *h_x, void *h_b, QudaInvertParam *param)
if (param->dirac_order == QUDA_CPS_WILSON_DIRAC_ORDER) kappa *= cudaGaugePrecise.anisotropy;
FullSpinor b, x;
ParitySpinor in = allocateParitySpinor(cudaGaugePrecise.X, invert_param->cuda_prec, invert_param->sp_pad);// source
ParitySpinor out = allocateParitySpinor(cudaGaugePrecise.X, invert_param->cuda_prec, invert_param->sp_pad);// solution
ParitySpinor tmp = allocateParitySpinor(cudaGaugePrecise.X, invert_param->cuda_prec, invert_param->sp_pad);// temporary
ParitySpinor in = allocateParitySpinor(cudaGaugePrecise.X, param->cuda_prec, param->sp_pad); // source
ParitySpinor out = allocateParitySpinor(cudaGaugePrecise.X, param->cuda_prec, param->sp_pad); // solution
ParitySpinor tmp = allocateParitySpinor(cudaGaugePrecise.X, param->cuda_prec, param->sp_pad); // temporary
if (param->solution_type == QUDA_MAT_SOLUTION) {
if (param->preserve_source == QUDA_PRESERVE_SOURCE_YES) {
b = allocateSpinorField(cudaGaugePrecise.X, invert_param->cuda_prec, invert_param->sp_pad);
b = allocateSpinorField(cudaGaugePrecise.X, param->cuda_prec, param->sp_pad);
} else {
b.even = out;
b.odd = tmp;
......
......@@ -7,8 +7,7 @@
#include <test_util.h>
QudaInvertParam inv_param;
QudaPrecision cuda_prec;
ParitySpinor x, y, z, w, v;
int nIters;
......@@ -22,23 +21,19 @@ void init() {
X[2] = 24;
X[3] = 64;
inv_param.cpu_prec = QUDA_DOUBLE_PRECISION;
inv_param.cuda_prec = QUDA_HALF_PRECISION;
inv_param.verbosity = QUDA_VERBOSE;
inv_param.sp_pad = 0;
invert_param = &inv_param;
cuda_prec = QUDA_HALF_PRECISION;
int sp_pad = 0;
int dev = 0;
initQuda(dev);
// need single parity dimensions
X[0] /= 2;
v = allocateParitySpinor(X, inv_param.cuda_prec, inv_param.sp_pad);
w = allocateParitySpinor(X, inv_param.cuda_prec, inv_param.sp_pad);
x = allocateParitySpinor(X, inv_param.cuda_prec, inv_param.sp_pad);
y = allocateParitySpinor(X, inv_param.cuda_prec, inv_param.sp_pad);
z = allocateParitySpinor(X, inv_param.cuda_prec, inv_param.sp_pad);
v = allocateParitySpinor(X, cuda_prec, sp_pad);
w = allocateParitySpinor(X, cuda_prec, sp_pad);
x = allocateParitySpinor(X, cuda_prec, sp_pad);
y = allocateParitySpinor(X, cuda_prec, sp_pad);
z = allocateParitySpinor(X, cuda_prec, sp_pad);
}
......@@ -202,7 +197,7 @@ int main(int argc, char** argv) {
}
char filename[100];
sprintf(filename, "%d_blas.dat", inv_param.cuda_prec);
sprintf(filename, "%d_blas.dat", cuda_prec);
FILE *blas_out = fopen(filename, "w");
nIters = 300;
......
......@@ -89,7 +89,6 @@ void init() {
inv_param.verbosity = QUDA_VERBOSE;
gauge_param = &gaugeParam;
invert_param = &inv_param;
// construct input fields
for (int dir = 0; dir < 4; dir++) hostGauge[dir] = malloc(V*gaugeSiteSize*gaugeParam.cpu_prec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment