From 51f7d5e242252c9639aaa2375f8192237f59ae7d Mon Sep 17 00:00:00 2001 From: M Clark Date: Thu, 14 May 2015 22:40:15 -0700 Subject: [PATCH] When doing full-field fermions, the odd-field ghost pointers need to be updated after the subsets have been created. This should fix #231. --- lib/cuda_color_spinor_field.cu | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/cuda_color_spinor_field.cu b/lib/cuda_color_spinor_field.cu index 3e1bdb1581..846cee613d 100644 --- a/lib/cuda_color_spinor_field.cu +++ b/lib/cuda_color_spinor_field.cu @@ -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(odd))->v = (void*)((char*)v + bytes/2); if (precision == QUDA_HALF_PRECISION) (dynamic_cast(odd))->norm = (void*)((char*)norm + norm_bytes/2); + for(int i=0; i(odd))->ghost[i] = + static_cast((dynamic_cast(odd))->ghost[i]) + bytes/2; + if(precision == QUDA_HALF_PRECISION) + (dynamic_cast(odd))->ghostNorm[i] = + static_cast((dynamic_cast(odd))->ghostNorm[i]) + norm_bytes/2; + } + } + #ifdef USE_TEXTURE_OBJECTS dynamic_cast(even)->destroyTexObject(); dynamic_cast(even)->createTexObject();