Skip to content

Commit

Permalink
When doing full-field fermions, the odd-field ghost pointers need to …
Browse files Browse the repository at this point in the history
…be updated after the subsets have been created. This should fix #231.
  • Loading branch information
maddyscientist committed May 15, 2015
1 parent 0859c72 commit 51f7d5e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/cuda_color_spinor_field.cu
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,21 @@ namespace quda {
even = new cudaColorSpinorField(*this, param);
odd = new cudaColorSpinorField(*this, param);

// need this hackery for the moment (need to locate the odd pointer half way into the full field)
// need this hackery for the moment (need to locate the odd pointers half way into the full field)
(dynamic_cast<cudaColorSpinorField*>(odd))->v = (void*)((char*)v + bytes/2);
if (precision == QUDA_HALF_PRECISION)
(dynamic_cast<cudaColorSpinorField*>(odd))->norm = (void*)((char*)norm + norm_bytes/2);

for(int i=0; i<nDim; ++i){
if(commDimPartitioned(i)){
(dynamic_cast<cudaColorSpinorField*>(odd))->ghost[i] =
static_cast<char*>((dynamic_cast<cudaColorSpinorField*>(odd))->ghost[i]) + bytes/2;
if(precision == QUDA_HALF_PRECISION)
(dynamic_cast<cudaColorSpinorField*>(odd))->ghostNorm[i] =
static_cast<char*>((dynamic_cast<cudaColorSpinorField*>(odd))->ghostNorm[i]) + norm_bytes/2;
}
}

#ifdef USE_TEXTURE_OBJECTS
dynamic_cast<cudaColorSpinorField*>(even)->destroyTexObject();
dynamic_cast<cudaColorSpinorField*>(even)->createTexObject();
Expand Down

0 comments on commit 51f7d5e

Please sign in to comment.