From 71eaa4e7b4aba49efef39391f3e1bb3a7e4e1529 Mon Sep 17 00:00:00 2001 From: Mengchi Zhang Date: Wed, 3 Jul 2019 02:44:08 -0400 Subject: Connect gpgpu_context and GPGPUsim_ctx Signed-off-by: Mengchi Zhang --- src/gpgpusim_entrypoint.cc | 6 +++--- src/gpgpusim_entrypoint.h | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index 476a9d4..c91a9d1 100644 --- a/src/gpgpusim_entrypoint.cc +++ b/src/gpgpusim_entrypoint.cc @@ -43,11 +43,11 @@ static int sg_argc = 3; static const char *sg_argv[] = {"", "-config","gpgpusim.config"}; -struct GPGPUsim_ctx* the_gpgpusim = NULL; +GPGPUsim_ctx* the_gpgpusim = NULL; -struct GPGPUsim_ctx* GPGPUsim_ctx_ptr(){ +GPGPUsim_ctx* GPGPUsim_ctx_ptr(){ if(the_gpgpusim == NULL) - the_gpgpusim = new GPGPUsim_ctx(); + the_gpgpusim = GPGPU_Context()->the_gpgpusim; return the_gpgpusim; } diff --git a/src/gpgpusim_entrypoint.h b/src/gpgpusim_entrypoint.h index a443151..dfb82d0 100644 --- a/src/gpgpusim_entrypoint.h +++ b/src/gpgpusim_entrypoint.h @@ -34,11 +34,11 @@ #include //extern time_t g_simulation_starttime; +class gpgpu_context; - -struct GPGPUsim_ctx { - - GPGPUsim_ctx() { +class GPGPUsim_ctx { + public: + GPGPUsim_ctx(gpgpu_context* ctx) { g_sim_active = false; g_sim_done = true; break_limit = false; @@ -49,6 +49,7 @@ struct GPGPUsim_ctx { g_stream_manager=NULL; the_cude_device=NULL; the_context=NULL; + gpgpu_ctx = ctx; } //struct gpgpu_ptx_sim_arg *grid_params; @@ -65,6 +66,7 @@ struct GPGPUsim_ctx { struct _cuda_device_id *the_cude_device; struct CUctx_st* the_context; + gpgpu_context* gpgpu_ctx; pthread_mutex_t g_sim_lock; -- cgit v1.3