Skip to content

Commit

Permalink
[bug] fix incorrect normalization for GPU mmc, fix #100
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Oct 16, 2024
1 parent 8867302 commit c646344
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mmc_core.cl
Original file line number Diff line number Diff line change
Expand Up @@ -1704,8 +1704,12 @@ __device__ void onephoton(unsigned int id, __local float* ppath, __constant MCXP
savedebugdata(&r, id, reporter, gdebugdata, gcfg);
}

for (oldeid = 0; oldeid < GPU_PARAM(gcfg, srcnum); oldeid++) {
energyesc[oldeid] += r.weight * ppath[GPU_PARAM(gcfg, reclen) + oldeid];
if (GPU_PARAM(gcfg, srcnum) == 1) {
*energyesc += r.weight;
} else {
for (oldeid = 0; oldeid < GPU_PARAM(gcfg, srcnum); oldeid++) {
energyesc[oldeid] += r.weight * ppath[GPU_PARAM(gcfg, reclen) + oldeid];
}
}
}

Expand Down

0 comments on commit c646344

Please sign in to comment.