From e8cd4cd8f9a6cfdb5ba2cf9eec044b08b1f3f176 Mon Sep 17 00:00:00 2001 From: Qianqian Fang Date: Wed, 13 Mar 2024 00:37:42 -0400 Subject: [PATCH] [bug] further fix of multi-source replay, #215 --- src/mcx_core.cu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mcx_core.cu b/src/mcx_core.cu index aa52ca87..f70505a9 100644 --- a/src/mcx_core.cu +++ b/src/mcx_core.cu @@ -1153,6 +1153,10 @@ __device__ inline int launchnewphoton(MCXpos* p, MCXdir* v, Stokes* s, MCXtime* } } + if (gcfg->issaveseed) { + copystate(t, photonseed); + } + if (gcfg->extrasrclen && gcfg->srcid != 1) { if (gcfg->srcid > 1) { launchsrc = (MCXSrc*)(gproperty + gcfg->maxmedia + 1 + gcfg->detnum + ((gcfg->srcid - 2) * 4)); @@ -1177,10 +1181,6 @@ __device__ inline int launchnewphoton(MCXpos* p, MCXdir* v, Stokes* s, MCXtime* *idx1d = *((uint*)&launchsrc->param2.z); /**< pre-computed 1D index of the photon at launch for pencil/isotropic beams */ *mediaid = *((uint*)&launchsrc->param2.w); /**< pre-computed media index of the photon at launch for pencil/isotropic beams */ - if (gcfg->issaveseed) { - copystate(t, photonseed); - } - *rv = float3(launchsrc->pos.x, launchsrc->pos.y, launchsrc->pos.z); //< reuse as the origin of the src, needed for focusable sources if (issvmc) {