Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can anybody tell me how it bypass timing simulation when choosing the -gpgpu_ptx_sim_mode 1 to use pure func simulation mode? #309

Open
underwerd opened this issue Dec 11, 2024 · 0 comments

Comments

@underwerd
Copy link

I know it can bypass timing simulation when choose func simulation mode,because I haved ran two situations in -gpgpu_ptx_sim_mode 1 and -gpgpu_ptx_sim_mode 0,the time of running in mode 1 is less than mode 0.
But when I try to find how in the source code,I meet some difficulties.
In gpgpu_entrypoint.cc,void *gpgpu_sim_thread_concurrent(void *ctx_ptr),it has code that

      // functional simulation
      if (ctx->the_gpgpusim->g_the_gpu->is_functional_sim()) {
        kernel_info_t *kernel =
            ctx->the_gpgpusim->g_the_gpu->get_functional_kernel();
        assert(kernel);
        ctx->the_gpgpusim->gpgpu_ctx->func_sim->gpgpu_cuda_ptx_sim_main_func(
            *kernel);
        ctx->the_gpgpusim->g_the_gpu->finish_functional_sim(kernel);
      }
      if (ctx->the_gpgpusim->g_the_gpu->active()) {
        ctx->the_gpgpusim->g_the_gpu->cycle();
        sim_cycles = true;
        ctx->the_gpgpusim->g_the_gpu->deadlock_check();
      } else {
        if (ctx->the_gpgpusim->g_the_gpu->cycle_insn_cta_max_hit()) {
          printf("cycle_insn_cta_max_hit()\n");
          fflush(stdout);
          ctx->the_gpgpusim->g_stream_manager->stop_all_running_kernels();
          ctx->the_gpgpusim->g_sim_done = true;
          ctx->the_gpgpusim->break_limit = true;
        }
      }

When I debug the code,I fine when I choose sim mode 1,ctx->the_gpgpusim->g_the_gpu->active(),but I can't find when or how active() if false ,it was set when init or other time?
And,I find when I choose sim mode 1,ctx->the_gpgpusim->g_the_gpu->cycle_insn_cta_max_hit() is also false, which means the while is not break because ctx->the_gpgpusim->g_sim_done = true; in ctx->the_gpgpusim->g_the_gpu->cycle_insn_cta_max_hit() , so how the while break ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant