diff --git a/paddle/fluid/framework/CMakeLists.txt b/paddle/fluid/framework/CMakeLists.txt index c72e53308e65857c6488a484d0da568dc740a5d4..85806014312e573e3d1c496cc5509a14661fb773 100755 --- a/paddle/fluid/framework/CMakeLists.txt +++ b/paddle/fluid/framework/CMakeLists.txt @@ -509,13 +509,9 @@ cc_library( operator glog version + xxhash dist_attr) -if(WITH_CRYPTO) - add_dependencies(proto_desc cryptopp) - target_link_libraries(proto_desc cryptopp) -endif() - cc_library( op_registry SRCS op_registry.cc diff --git a/paddle/fluid/framework/program_desc.cc b/paddle/fluid/framework/program_desc.cc index 7b4f0a71a53c043509a69ae857952e60a8876359..79e8f0bba00cbab2604ca721bf263a84cfcb38ba 100644 --- a/paddle/fluid/framework/program_desc.cc +++ b/paddle/fluid/framework/program_desc.cc @@ -14,12 +14,13 @@ limitations under the License. */ #include "paddle/fluid/framework/program_desc.h" +extern "C" { +#include +} + #include #include "paddle/fluid/framework/feed_fetch_type.h" #include "paddle/fluid/framework/version.h" -#ifdef PADDLE_WITH_CRYPTO -#include "paddle/fluid/framework/io/crypto/sha.h" -#endif namespace paddle { namespace framework { @@ -257,11 +258,9 @@ std::string ProgramDesc::CachedHashString() { if (cached_hash_str_.size() == 0 || NeedUpdate()) { Flush(); desc_.SerializePartialToString(&serialize_str); -#ifdef PADDLE_WITH_CRYPTO - cached_hash_str_ = HexEncoding(GetSha1(serialize_str)); -#else - cached_hash_str_ = serialize_str; -#endif + // non-cryptographic is enough + cached_hash_str_ = + std::to_string(XXH64(serialize_str.c_str(), serialize_str.size(), 1)); } return cached_hash_str_; }