int main (int argc, char *argv[]) { Config mcxconfig; unsigned int activedev=0; float *fluence=NULL,totalenergy=0.f; mcx_initcfg(&mcxconfig); // parse command line options to initialize the configurations mcx_parsecmd(argc,argv,&mcxconfig); // identify gpu number and set one gpu active if(!mcx_set_gpu(&mcxconfig,&activedev)){ mcx_error(-1,"No compute platform was found\n",__FILE__,__LINE__); } if(activedev==0) return 0; mcx_createfluence(&fluence,&mcxconfig); // this launches the MC simulation mcx_run_simulation(&mcxconfig,fluence,&totalenergy); // clean up the allocated memory in the config mcx_clearfluence(&fluence); mcx_clearcfg(&mcxconfig); return 0; }
int main (int argc, char *argv[]) { Config mcxconfig; float *fluence=NULL,totalenergy=0.f; mcx_initcfg(&mcxconfig); // parse command line options to initialize the configurations mcx_parsecmd(argc,argv,&mcxconfig); mcx_createfluence(&fluence,&mcxconfig); // this launches the MC simulation mcx_run_simulation(&mcxconfig,fluence,&totalenergy); // clean up the allocated memory in the config mcx_clearfluence(&fluence); mcx_clearcfg(&mcxconfig); return 0; }
void mcx_createfluence(float **fluence, Config *cfg){ mcx_clearfluence(fluence); *fluence=(float*)calloc(cfg->dim.x*cfg->dim.y*cfg->dim.z,cfg->maxgate*sizeof(float)); }