From 9a0e4e4a776a963c9950dc3dcd0d23ee0739b755 Mon Sep 17 00:00:00 2001 From: Wilson Fung Date: Thu, 26 Jul 2012 03:22:53 -0800 Subject: 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] --- src/cuda-sim/memory.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/cuda-sim/memory.h') diff --git a/src/cuda-sim/memory.h b/src/cuda-sim/memory.h index 5ebc0ad..f785b8b 100644 --- a/src/cuda-sim/memory.h +++ b/src/cuda-sim/memory.h @@ -30,23 +30,12 @@ #include "../abstract_hardware_model.h" -#ifdef __GNUC__ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 - #include - #define mem_map std::unordered_map - #define MEM_MAP_RESIZE(hash_size) m_data.rehash(hash_size) -#else - #include - namespace std { - using namespace __gnu_cxx; - } - #define mem_map std::hash_map - #define MEM_MAP_RESIZE(hash_size) m_data.resize(hash_size) -#endif -#else - #include - #define mem_map std::map +#include "../tr1_hash_map.h" +#define mem_map tr1_hash_map +#if tr1_hash_map_ismap == 1 #define MEM_MAP_RESIZE(hash_size) +#else + #define MEM_MAP_RESIZE(hash_size) (m_data.rehash(hash_size)) #endif #include -- cgit v1.3