From 8c2954c263b4cfd756188362919c1a16a7189788 Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Fri, 8 Oct 2010 07:21:51 -0800 Subject: 1. refactoring cuda api code for loading PTX (removing external PTX loading entirely) 2. some bug fixes for warp_inst_t 3. creating a new class, gpgpu_t, which contains the functional "memory" state visible to all threads running on a GPU (doing this as part of my continuing effort to hunt down and eradicate every global variable that is not the top level "the gpu") 4. other misc. changes Almost passing CUDA 3.1 regression? oclHistogram keeps failing under torque, but does not fail when run on the command line from the same directory. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7827] --- src/debug.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/debug.cc') diff --git a/src/debug.cc b/src/debug.cc index 7bc72ac..c1aa3c6 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -61,7 +61,8 @@ void gpgpu_sim::gpgpu_debug() brk_pt &b=i->second; if( b.is_watchpoint() ) { unsigned addr = b.get_addr(); - unsigned new_value = read_location(addr); + unsigned new_value; + g_global_mem->read(addr,4,&new_value); if( new_value != b.get_value() || g_watchpoint_hits.find(num) != g_watchpoint_hits.end() ) { printf( "GPGPU-Sim PTX DBG: watch point %u triggered (old value=%x, new value=%x)\n", num,b.get_value(),new_value ); @@ -155,7 +156,8 @@ void gpgpu_sim::gpgpu_debug() tok = strtok(NULL," \t\n"); unsigned addr; sscanf(tok,"%x",&addr); - unsigned value = read_location(addr); + unsigned value; + g_global_mem->read(addr,4,&value); g_global_mem->set_watch(addr,next_brkpt); breakpoints[next_brkpt++] = brk_pt(addr,value); } else if( !strcmp(tok,"l") ) { @@ -199,9 +201,3 @@ bool thread_at_brkpt( ptx_thread_info *thread, const struct brk_pt &b ) return b.is_equal(thread->get_location(),thread->get_uid()); } -unsigned read_location( addr_t addr ) -{ - unsigned result=0; - g_global_mem->read(addr,4,&result); - return result; -} -- cgit v1.3