summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2012-07-26 03:22:53 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:48:52 -0700
commit9a0e4e4a776a963c9950dc3dcd0d23ee0739b755 (patch)
tree70c6f73230fe8fcfdd0fd2a3a7eb525e1f145b80 /src/gpgpu-sim
parent1c7ed16cc28f1d740ac7abc773eb4016d49fcba4 (diff)
Clean up the unordered_map fallback support.
- Now there is only one macro for all use of unordered_map in the code. - Moving all instances of gcc/cuda version detection into a single file. - Adding a warning when the fallback is triggered. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13542]
Diffstat (limited to 'src/gpgpu-sim')
-rw-r--r--src/gpgpu-sim/Makefile3
-rw-r--r--src/gpgpu-sim/addrdec.cc4
-rw-r--r--src/gpgpu-sim/gpu-cache.h8
-rw-r--r--src/gpgpu-sim/histogram.h1
-rw-r--r--src/gpgpu-sim/stat-tool.cc2
-rw-r--r--src/gpgpu-sim/stat-tool.h2
6 files changed, 13 insertions, 7 deletions
diff --git a/src/gpgpu-sim/Makefile b/src/gpgpu-sim/Makefile
index 4f636fb..fdb4503 100644
--- a/src/gpgpu-sim/Makefile
+++ b/src/gpgpu-sim/Makefile
@@ -38,7 +38,8 @@ else
CXXFLAGS_L2CACHE = -Wall
endif
-GNUC_CPP0X := $(shell gcc --version | perl -ne 'if (/gcc\s+\(.*\)\s+([0-9.]+)/){ if($$1 >= 4.3) {$$n=1} else {$$n=0;} } END { print $$n; }')
+include ../../version_detection.mk
+
ifeq ($(GNUC_CPP0X), 1)
CXXFLAGS += -std=c++0x
CXXFLAGS_L2CACHE += -std=c++0x
diff --git a/src/gpgpu-sim/addrdec.cc b/src/gpgpu-sim/addrdec.cc
index 868696d..9b2f339 100644
--- a/src/gpgpu-sim/addrdec.cc
+++ b/src/gpgpu-sim/addrdec.cc
@@ -331,7 +331,11 @@ void linear_to_raw_address_translation::sweep_test() const
{
new_addr_type sweep_range = 16 * 1024 * 1024;
+#if tr1_hash_map_ismap == 1
+ typedef tr1_hash_map<addrdec_t, new_addr_type> history_map_t;
+#else
typedef tr1_hash_map<addrdec_t, new_addr_type, hash_addrdec_t> history_map_t;
+#endif
history_map_t history_map;
for (new_addr_type raw_addr = 4; raw_addr < sweep_range; raw_addr += 4) {
diff --git a/src/gpgpu-sim/gpu-cache.h b/src/gpgpu-sim/gpu-cache.h
index ecb1059..3f67ffe 100644
--- a/src/gpgpu-sim/gpu-cache.h
+++ b/src/gpgpu-sim/gpu-cache.h
@@ -275,9 +275,9 @@ class mshr_table {
public:
mshr_table( unsigned num_entries, unsigned max_merged )
: m_num_entries(num_entries),
- m_max_merged(max_merged),
-#ifndef USE_MAP
- m_data(2*num_entries)
+ m_max_merged(max_merged)
+#if (tr1_hash_map_ismap == 0)
+ ,m_data(2*num_entries)
#endif
{
}
@@ -377,7 +377,7 @@ private:
bool m_has_atomic;
mshr_entry() : m_has_atomic(false) { }
};
- typedef my_hash_map<new_addr_type,mshr_entry> table;
+ typedef tr1_hash_map<new_addr_type,mshr_entry> table;
table m_data;
// it may take several cycles to process the merged requests
diff --git a/src/gpgpu-sim/histogram.h b/src/gpgpu-sim/histogram.h
index a38a0aa..e8fd375 100644
--- a/src/gpgpu-sim/histogram.h
+++ b/src/gpgpu-sim/histogram.h
@@ -30,6 +30,7 @@
#ifdef __cplusplus
+#include <stdio.h>
#include <string>
class binned_histogram {
diff --git a/src/gpgpu-sim/stat-tool.cc b/src/gpgpu-sim/stat-tool.cc
index 94998f2..6a4c75b 100644
--- a/src/gpgpu-sim/stat-tool.cc
+++ b/src/gpgpu-sim/stat-tool.cc
@@ -479,7 +479,7 @@ void shader_CTA_count_visualizer_gzprint( gzFile fout )
thread_insn_span::thread_insn_span(unsigned long long cycle)
: m_cycle(cycle),
-#ifdef USE_MAP
+#if (tr1_hash_map_ismap == 1)
m_insn_span_count()
#else
m_insn_span_count(32*1024)
diff --git a/src/gpgpu-sim/stat-tool.h b/src/gpgpu-sim/stat-tool.h
index 062d4bd..5646f01 100644
--- a/src/gpgpu-sim/stat-tool.h
+++ b/src/gpgpu-sim/stat-tool.h
@@ -95,7 +95,7 @@ public:
void print_sparse_histo(gzFile fout) const;
private:
- typedef my_hash_map<address_type, int> span_count_map;
+ typedef tr1_hash_map<address_type, int> span_count_map;
unsigned long long m_cycle;
span_count_map m_insn_span_count;
};