Skip to content

Commit

Permalink
fix output detected photon information for SSE-MMCL and GPU-MMCL, but…
Browse files Browse the repository at this point in the history
… MMCL cant run on GPU#2 of neza or output detected images on GPU#3
  • Loading branch information
ShijieYanNEU committed Jul 26, 2019
1 parent a3b7714 commit 9e800e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/mmc_core.cl
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,8 @@ void onephoton(unsigned int id,__local float *ppath, __constant MCXParam *gcfg,_
r.vec.x,r.vec.y,r.vec.z,r.weight,r.eid));
#ifdef MCX_SAVE_DETECTORS
if(gcfg->issavedet && gcfg->issaveexit){ /*when issaveexit is set to 1*/
copystate(ppath+(gcfg->reclen-6),(float *)&(r.p0),3); /*columns 7-5 from the right store the exit positions*/
copystate(ppath+(gcfg->reclen-3),(float *)&(r.vec),3); /*columns 4-2 from the right store the exit dirs*/
copystate(ppath+(gcfg->reclen-7),(float *)&(r.p0),3); /*columns 7-5 from the right store the exit positions*/
copystate(ppath+(gcfg->reclen-4),(float *)&(r.vec),3); /*columns 4-2 from the right store the exit dirs*/
}
#endif
}else if(r.faceid==-2 && (gcfg->debuglevel&dlMove)){
Expand Down
2 changes: 1 addition & 1 deletion src/mmc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ int mmc_run_mp(mcconfig *cfg, tetmesh *mesh, raytracer *tracer){
}
if(cfg->issavedet){
MMCDEBUG(cfg,dlTime,(cfg->flog,"saving detected photons ..."));
if(cfg->issaveexit==1)
if(cfg->issaveexit==1 || cfg->issaveexit==2)
mesh_savedetphoton(master.partialpath,master.photonseed,master.bufpos,(sizeof(RandType)*RAND_BUF_LEN),cfg);
else if(cfg->issaveexit==2){
float *detimage=(float*)calloc(cfg->detparam1.w*cfg->detparam2.w*cfg->maxgate,sizeof(float));
Expand Down
8 changes: 7 additions & 1 deletion src/simpmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,13 @@ void mesh_savedetphoton(float *ppath, void *seeds, int count, int seedbyte, mcco
cfg->his.seedbyte=seedbyte;
}
cfg->his.colcount=(2+(cfg->ismomentum>0))*cfg->his.maxmedia+(cfg->issaveexit>0)*6+2; /*column count=maxmedia+3*/


if(count>0 && cfg->exportdetected==NULL){
cfg->detectedcount=count;
cfg->exportdetected=(float*)malloc(cfg->his.colcount*cfg->detectedcount*sizeof(float));
}
memcpy(cfg->exportdetected,ppath,count*cfg->his.colcount*sizeof(float));

fwrite(&(cfg->his),sizeof(history),1,fp);
fwrite(ppath,sizeof(float),count*cfg->his.colcount,fp);
if(cfg->issaveseed && seeds!=NULL)
Expand Down

0 comments on commit 9e800e0

Please sign in to comment.