From 87e4da5fc6086c3d0a661af1929255a8cbd728d7 Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Mon, 18 Oct 2010 02:43:17 -0800 Subject: Re-designed cache model: - read only cache model with integrated mshrs (no L1D, yet); new cache interface should be easily extendable to support texture cache with latency fifo and separate tag/data arrays, though this is not yet added (currently tags and data arrays are not decoupled for texture) - new partition model using the above removes all old MSHRs, L1D etc... passing CUDA 3.1 regression [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7875] --- src/tr1_hash_map.h | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'src/tr1_hash_map.h') diff --git a/src/tr1_hash_map.h b/src/tr1_hash_map.h index 1ff7c8e..f7813ae 100644 --- a/src/tr1_hash_map.h +++ b/src/tr1_hash_map.h @@ -3,20 +3,38 @@ // detection and fallback for unordered_map in C++0x #ifdef __cplusplus #ifdef __GNUC__ - #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 - #include - #define tr1_hash_map std::unordered_map - #define tr1_hash_map_ismap 0 + #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 + #include + #define tr1_hash_map std::unordered_map + #define tr1_hash_map_ismap 0 + #else + #include + #define tr1_hash_map std::map + #define tr1_hash_map_ismap 1 + #endif #else #include #define tr1_hash_map std::map #define tr1_hash_map_ismap 1 #endif - #else - #include - #define tr1_hash_map std::map - #define tr1_hash_map_ismap 1 - #endif -#endif + // detect gcc 4.3 and use unordered map (part of c++0x) + // unordered map doesn't play nice with _GLIBCXX_DEBUG, just use a map if its enabled. + #if defined( __GNUC__ ) and not defined( _GLIBCXX_DEBUG ) + #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 + #include + #define my_hash_map std::unordered_map + #else + #include + namespace std { + using namespace __gnu_cxx; + } + #define my_hash_map std::hash_map + #endif + #else + #include + #define my_hash_map std::map + #define USE_MAP + #endif +#endif -- cgit v1.3