Skip to content

Commit

Permalink
fix dref double multiplying initial weight bug, critical
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Aug 4, 2020
1 parent 71d4196 commit c04bff5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mcx_core.cu
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,9 @@ __device__ inline int launchnewphoton(MCXpos *p,MCXdir *v,MCXtime *f,float3* rv,
for(int i=0;i<gcfg->srcnum;i++){
if(ppath[gcfg->w0offset+i]>0.f){
#ifdef USE_ATOMIC
atomicAdd(& field[(*idx1d+tshift*gcfg->dimlen.z)*gcfg->srcnum+i],-p->w*ppath[gcfg->w0offset+i]);
atomicAdd(& field[(*idx1d+tshift*gcfg->dimlen.z)*gcfg->srcnum+i],-((gcfg->srcnum==1)?p->w:p->w*ppath[gcfg->w0offset+i]));
#else
field[(*idx1d+tshift*gcfg->dimlen.z)*gcfg->srcnum+i]+=-p->w*ppath[gcfg->w0offset+i];
field[(*idx1d+tshift*gcfg->dimlen.z)*gcfg->srcnum+i]+=-((gcfg->srcnum==1)?p->w:p->w*ppath[gcfg->w0offset+i]);
#endif
}
}
Expand Down

0 comments on commit c04bff5

Please sign in to comment.