Move TRT VectorTensorShapeHasher trt_lru_cache.h to convert/utils.h

This commit is contained in:
Tamas Bela Feher 2019-12-11 16:16:44 +01:00
parent 2cf2298880
commit 549999490d
2 changed files with 8 additions and 7 deletions

View File

@ -51,6 +51,14 @@ Status TrtPrecisionModeToName(TrtPrecisionMode mode, string* name);
Status TrtPrecisionModeFromName(const string& name, TrtPrecisionMode* mode);
// Define a hash function for vector<TensorShape> because it is used as the key
// for the engine cache.
struct VectorTensorShapeHasher {
std::size_t operator()(const std::vector<TensorShape>& key) const {
return std::hash<std::string>()(TensorShapeUtils::ShapeListString(key));
}
};
#if GOOGLE_CUDA && GOOGLE_TENSORRT
#define IS_TRT_VERSION_GE(major, minor, patch, build) \

View File

@ -114,13 +114,6 @@ class LRUCache {
}
};
// Define a hash function for vector<TensorShape> because it is used as the key
// for the engine cache.
struct VectorTensorShapeHasher {
std::size_t operator()(const std::vector<TensorShape>& key) const {
return std::hash<std::string>()(TensorShapeUtils::ShapeListString(key));
}
};
#if GOOGLE_CUDA
#if GOOGLE_TENSORRT