summaryrefslogtreecommitdiff
path: root/src/cuda-sim/ptx_sim.h
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-10-08 07:21:51 -0800
committerTor Aamodt <[email protected]>2010-10-08 07:21:51 -0800
commit8c2954c263b4cfd756188362919c1a16a7189788 (patch)
treee4827655db3edb26d4668fc42e78f1e5731afa02 /src/cuda-sim/ptx_sim.h
parent474e6d99c8efa9e3b8518eecb059546364370fd9 (diff)
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]
Diffstat (limited to 'src/cuda-sim/ptx_sim.h')
-rw-r--r--src/cuda-sim/ptx_sim.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/cuda-sim/ptx_sim.h b/src/cuda-sim/ptx_sim.h
index 80ccde3..298122e 100644
--- a/src/cuda-sim/ptx_sim.h
+++ b/src/cuda-sim/ptx_sim.h
@@ -276,6 +276,16 @@ public:
~ptx_thread_info();
ptx_thread_info();
+ void init(gpgpu_t *gpu, core_t *core, unsigned sid, unsigned cta_id, unsigned wid, unsigned tid )
+ {
+ m_gpu = gpu;
+ m_core = core;
+ m_hw_sid=sid;
+ m_hw_ctaid=cta_id;
+ m_hw_wid=wid;
+ m_hw_tid=tid;
+ }
+
void ptx_fetch_inst( inst_t &inst ) const;
void ptx_exec_inst( warp_inst_t &inst, unsigned lane_id );
@@ -310,11 +320,6 @@ public:
unsigned get_hw_ctaid() const { return m_hw_ctaid;}
unsigned get_hw_wid() const { return m_hw_wid;}
unsigned get_hw_sid() const { return m_hw_sid;}
- void set_hw_tid(unsigned tid) { m_hw_tid=tid;}
- void set_hw_wid(unsigned wid) { m_hw_wid=wid;}
- void set_hw_sid(unsigned sid) { m_hw_sid=sid;}
- void set_hw_ctaid(unsigned cta_id) { m_hw_ctaid=cta_id;}
- void set_core(core_t *core) { m_core = core; }
core_t *get_core() { return m_core; }
unsigned get_icount() const { return m_icount;}
@@ -421,6 +426,11 @@ public:
void enable_debug_trace() { m_enable_debug_trace = true; }
unsigned get_local_mem_stack_pointer() const { return m_local_mem_stack_pointer; }
+ memory_space *get_global_memory() { return m_gpu->get_global_memory(); }
+ memory_space *get_tex_memory() { return m_gpu->get_tex_memory(); }
+ memory_space *get_surf_memory() { return m_gpu->get_surf_memory(); }
+ memory_space *get_param_memory() { return m_gpu->get_param_memory(); }
+
public:
addr_t m_last_effective_address;
bool m_branch_taken;
@@ -436,6 +446,7 @@ private:
unsigned m_uid;
core_t *m_core;
+ gpgpu_t *m_gpu;
bool m_valid;
dim3 m_ntid;
dim3 m_tid;