forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add farmhash fingerprint64 into hash.h and include corresponding depe…
…ndencies. Change: 122273744
- Loading branch information
1 parent
f24b027
commit 50fd130
Showing
6 changed files
with
105 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
prefix_dir = "farmhash-34c13ddfab0e35422f4c3979f360635a8c050260" | ||
|
||
genrule( | ||
name = "configure", | ||
srcs = glob( | ||
["**/*"], | ||
exclude = [prefix_dir + "/config.h"], | ||
), | ||
outs = [prefix_dir + "/config.h"], | ||
cmd = "pushd external/farmhash_archive/%s; workdir=$$(mktemp -d -t tmp.XXXXXXXXXX); cp -a * $$workdir; pushd $$workdir; ./configure; popd; popd; cp $$workdir/config.h $(@D); rm -rf $$workdir;" % prefix_dir, | ||
) | ||
|
||
cc_library( | ||
name = "farmhash", | ||
srcs = [prefix_dir + "/src/farmhash.cc"], | ||
hdrs = [prefix_dir + "/src/farmhash.h"] + [":configure"], | ||
includes = [prefix_dir], | ||
visibility = ["//visibility:public"] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* Copyright 2016 Google Inc. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
#ifndef TENSORFLOW_CORE_PLATFORM_DEFAULT_FINGERPRINT_H_ | ||
#define TENSORFLOW_CORE_PLATFORM_DEFAULT_FINGERPRINT_H_ | ||
|
||
#include "farmhash-34c13ddfab0e35422f4c3979f360635a8c050260/src/farmhash.h" | ||
|
||
namespace tensorflow { | ||
|
||
inline uint64 Fingerprint64(const string& s) { | ||
return ::util::Fingerprint64(s); | ||
} | ||
|
||
} // namespace tensorflow | ||
|
||
#endif // TENSORFLOW_CORE_PLATFORM_DEFAULT_FINGERPRINT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* Copyright 2016 Google Inc. All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
#ifndef TENSORFLOW_CORE_PLATFORM_FINGERPRINT_H_ | ||
#define TENSORFLOW_CORE_PLATFORM_FINGERPRINT_H_ | ||
|
||
#include "tensorflow/core/platform/types.h" | ||
|
||
namespace tensorflow { | ||
|
||
// This is a portable fingerprint interface for strings that will never change. | ||
// However, it is not suitable for cryptography. | ||
uint64 Fingerprint64(const string& s); | ||
|
||
} // namespace tensorflow | ||
|
||
#if defined(PLATFORM_GOOGLE) | ||
#include "tensorflow/core/platform/google/fingerprint.h" | ||
#else | ||
#include "tensorflow/core/platform/default/fingerprint.h" | ||
#endif | ||
|
||
#endif // TENSORFLOW_CORE_PLATFORM_FINGERPRINT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters