Skip to content

Commit

Permalink
Fixed memory bandwidth computations for 4-d preconditioned 5-d dslash…
Browse files Browse the repository at this point in the history
… operators (closes #315).
  • Loading branch information
maddyscientist committed Jul 16, 2015
1 parent cd6d195 commit 93836c0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/dslash_domain_wall_4d.cu
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,28 @@ namespace quda {
}
return flops;
}

long long bytes() const {
bool isHalf = in->Precision() == sizeof(short) ? true : false;
int spinor_bytes = 2 * in->Ncolor() * in->Nspin() * in->Precision() + (isHalf ? sizeof(float) : 0);
long long Ls = in->X(4);
long long bytes;

switch(DS_type){
case 0:
bytes = DslashCuda::bytes();
break;
case 1:
bytes = (x ? 5ll : 4ll ) * spinor_bytes * in->VolumeCB();
break;
case 2:
bytes = (x ? Ls + 2 : Ls + 1) * spinor_bytes * in->VolumeCB();
break;
default:
errorQuda("invalid Dslash type");
}
return bytes;
}
};
#endif // GPU_DOMAIN_WALL_DIRAC

Expand Down
23 changes: 23 additions & 0 deletions lib/dslash_mobius.cu
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,29 @@ namespace quda {
}
return flops;
}

long long bytes() const {
bool isHalf = in->Precision() == sizeof(short) ? true : false;
int spinor_bytes = 2 * in->Ncolor() * in->Nspin() * in->Precision() + (isHalf ? sizeof(float) : 0);
long long Ls = in->X(4);
long long bytes;

switch(DS_type){
case 0:
bytes = DslashCuda::bytes();
break;
case 1:
case 2:
bytes = (x ? 5ll : 4ll) * spinor_bytes * in->VolumeCB();
break;
case 3:
bytes = (x ? Ls + 2 : Ls + 1) * spinor_bytes * in->VolumeCB();
break;
default:
errorQuda("invalid Dslash type");
}
return bytes;
}
};
#endif // GPU_DOMAIN_WALL_DIRAC

Expand Down

0 comments on commit 93836c0

Please sign in to comment.