1 #ifndef C10_UTIL_FBCODEMAPS_H_ 2 #define C10_UTIL_FBCODEMAPS_H_ 3 4 // Map typedefs so that we can use folly's F14 maps in fbcode without 5 // taking a folly dependency. 6 7 #ifdef FBCODE_CAFFE2 8 #include <folly/container/F14Map.h> 9 #include <folly/container/F14Set.h> 10 #else 11 #include <unordered_map> 12 #include <unordered_set> 13 #endif 14 15 namespace c10 { 16 #ifdef FBCODE_CAFFE2 17 template <typename Key, typename Value> 18 using FastMap = folly::F14FastMap<Key, Value>; 19 template <typename Key> 20 using FastSet = folly::F14FastSet<Key>; 21 #else 22 template <typename Key, typename Value> 23 using FastMap = std::unordered_map<Key, Value>; 24 template <typename Key> 25 using FastSet = std::unordered_set<Key>; 26 #endif 27 } // namespace c10 28 29 #endif // C10_UTIL_FBCODEMAPS_H_ 30