summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/l2cache.h
diff options
context:
space:
mode:
authorMahmoud Khairy A. Abdallah <[email protected]>2017-11-18 23:43:56 -0500
committerGitHub Enterprise <[email protected]>2017-11-18 23:43:56 -0500
commit77abdbf7a3c69631bceb5c96f4d3628447487612 (patch)
tree3c8de6a8d14739da6bc035c33a8c47292fe135c9 /src/gpgpu-sim/l2cache.h
parentdccac457bb2263602a6a244297168cae8fda8e47 (diff)
parentf125fecc85fdbb29ed846a2acfdb5e8c6cf20e41 (diff)
Merge pull request #1 from tgrogers/copy-kernel
Copy kernel
Diffstat (limited to 'src/gpgpu-sim/l2cache.h')
-rw-r--r--src/gpgpu-sim/l2cache.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpgpu-sim/l2cache.h b/src/gpgpu-sim/l2cache.h
index 2cc0e76..2d13918 100644
--- a/src/gpgpu-sim/l2cache.h
+++ b/src/gpgpu-sim/l2cache.h
@@ -72,6 +72,7 @@ public:
void print_stat( FILE *fp ) { m_dram->print_stat(fp); }
void visualize() const { m_dram->visualize(); }
void print( FILE *fp ) const;
+ void handle_memcpy_to_gpu( size_t dst_start_addr, unsigned subpart_id, mem_access_sector_mask_t mask );
class memory_sub_partition * get_sub_partition(int sub_partition_id)
{
@@ -178,6 +179,12 @@ public:
void accumulate_L2cache_stats(class cache_stats &l2_stats) const;
void get_L2cache_sub_stats(struct cache_sub_stats &css) const;
+ void force_l2_tag_update(new_addr_type addr, unsigned time, mem_access_sector_mask_t mask)
+ {
+ m_L2cache->force_tag_access( addr, m_memcpy_cycle_offset + time, mask );
+ m_memcpy_cycle_offset += 1;
+ }
+
private:
// data
unsigned m_id; //< the global sub partition ID
@@ -210,6 +217,13 @@ private:
friend class L2interface;
std::vector<mem_fetch*> breakdown_request_to_sector_requests(mem_fetch* mf);
+
+ // This is a cycle offset that has to be applied to the l2 accesses to account for
+ // the cudamemcpy read/writes. We want GPGPU-Sim to only count cycles for kernel execution
+ // but we want cudamemcpy to go through the L2. Everytime an access is made from cudamemcpy
+ // this counter is incremented, and when the l2 is accessed (in both cudamemcpyies and otherwise)
+ // this value is added to the gpgpu-sim cycle counters.
+ unsigned m_memcpy_cycle_offset;
};
class L2interface : public mem_fetch_interface {