Skip to content

Commit

Permalink
restore windows progress bar support, disabled in @ae2d60e45
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Aug 18, 2020
1 parent c3ff56e commit 883f61b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/mcx_core.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,9 @@ void mcx_run_simulation(Config *cfg,GPUInfo *gpu){
uint detected=0,sharedbuf=0;

volatile int *progress, *gprogress;
#ifdef _WIN32
cudaEvent_t updateprogress;
#endif

uint *gmedia;
float4 *gPpos,*gPdir,*gPlen;
Expand Down Expand Up @@ -2117,11 +2119,13 @@ void mcx_run_simulation(Config *cfg,GPUInfo *gpu){
CUDA_ASSERT(cudaMemcpy(gPseed, Pseed, sizeof(RandType)*gpu[gpuid].autothread*RAND_BUF_LEN, cudaMemcpyHostToDevice));
}
tic0=GetTimeMillis();
#ifdef _WIN32
#pragma omp master
{
if(cfg->debuglevel & MCX_DEBUG_PROGRESS)
CUDA_ASSERT(cudaEventCreate(&updateprogress));
}
#endif
MCX_FPRINTF(cfg->flog,"simulation run#%2d ... \n",iter+1); fflush(cfg->flog);
mcx_flush(cfg);

Expand All @@ -2144,14 +2148,14 @@ void mcx_run_simulation(Config *cfg,GPUInfo *gpu){
{
if((param.debuglevel & MCX_DEBUG_PROGRESS)){
int p0 = 0, ndone=-1;
//#ifndef WIN32
// CUDA_ASSERT(cudaEventRecord(updateprogress));
//#endif
#ifdef _WIN32
CUDA_ASSERT(cudaEventRecord(updateprogress));
#endif
mcx_progressbar(-0.f,cfg);
do{
//#ifndef WIN32
// CUDA_ASSERT(cudaEventQuery(updateprogress));
//#endif
#ifndef _WIN32
cudaEventQuery(updateprogress);
#endif
ndone = *progress;
if (ndone > p0){
mcx_progressbar(ndone/((param.threadphoton>>1)*4.5f),cfg);
Expand Down

0 comments on commit 883f61b

Please sign in to comment.