未验证 提交 a89e48fe 编写于 作者: L Leo Chen 提交者: GitHub

use xxhash instead of cryptopp (#45837)

上级 f7832fea
......@@ -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
......
......@@ -14,12 +14,13 @@ limitations under the License. */
#include "paddle/fluid/framework/program_desc.h"
extern "C" {
#include <xxhash.h>
}
#include <algorithm>
#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_;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册