Update XNNPACK and pthreadpool dependencies

PiperOrigin-RevId: 303355597
Change-Id: I43d6100167f83594d476c78997e7a4033a9bbdd0
This commit is contained in:
Marat Dukhan 2020-03-27 10:18:53 -07:00 committed by Lukas Geiger
parent ebed0c71a0
commit 542c112cfc
3 changed files with 54 additions and 10 deletions
tensorflow
third_party/pthreadpool

View File

@ -148,11 +148,11 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
tf_http_archive(
name = "XNNPACK",
sha256 = "77a4cea07169b4d67df456d50deffaa100e587192657c68ee4f2b7c12ba133d1",
strip_prefix = "XNNPACK-479e78c7f93a5764ffb221bdead3f290c7fd8ea3",
sha256 = "2afaaf5f866ec714358985b123c3115043b9e099638100937743997f02bbd8cb",
strip_prefix = "XNNPACK-05702cf4099ad019ad1abb8ba656bfe04304f32a",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/479e78c7f93a5764ffb221bdead3f290c7fd8ea3.zip",
"https://github.com/google/XNNPACK/archive/479e78c7f93a5764ffb221bdead3f290c7fd8ea3.zip",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/05702cf4099ad019ad1abb8ba656bfe04304f32a.zip",
"https://github.com/google/XNNPACK/archive/05702cf4099ad019ad1abb8ba656bfe04304f32a.zip",
],
)

View File

@ -10,6 +10,7 @@ exports_files(["LICENSE"])
cc_library(
name = "pthreadpool",
srcs = [
"src/threadpool-atomics.h",
"src/threadpool-pthreads.c",
"src/threadpool-utils.h",
],
@ -18,7 +19,15 @@ cc_library(
],
copts = [
"-O2",
],
] + select({
":optimized_build": ["-O2"],
"//conditions:default": [],
}) + select({
":linux_aarch64": ["-DPTHREADPOOL_USE_CPUINFO=1"],
":android_arm64": ["-DPTHREADPOOL_USE_CPUINFO=1"],
":android_armv7": ["-DPTHREADPOOL_USE_CPUINFO=1"],
"//conditions:default": ["-DPTHREADPOOL_USE_CPUINFO=0"],
}),
defines = [
"PTHREADPOOL_NO_DEPRECATED_API",
],
@ -28,5 +37,40 @@ cc_library(
strip_include_prefix = "include",
deps = [
"@FXdiv",
],
] + select({
":linux_aarch64": ["@cpuinfo"],
":android_arm64": ["@cpuinfo"],
":android_armv7": ["@cpuinfo"],
"//conditions:default": [],
}),
)
############################# Build configurations #############################
config_setting(
name = "optimized_build",
values = {
"compilation_mode": "opt",
},
)
config_setting(
name = "linux_aarch64",
values = {"cpu": "aarch64"},
)
config_setting(
name = "android_armv7",
values = {
"crosstool_top": "//external:android/crosstool",
"cpu": "armeabi-v7a",
},
)
config_setting(
name = "android_arm64",
values = {
"crosstool_top": "//external:android/crosstool",
"cpu": "arm64-v8a",
},
)

View File

@ -5,11 +5,11 @@ load("//third_party:repo.bzl", "third_party_http_archive")
def repo():
third_party_http_archive(
name = "pthreadpool",
strip_prefix = "pthreadpool-ebd50d0cfa3664d454ffdf246fcd228c3b370a11",
sha256 = "ca4fc774cf2339cb739bba827de8ed4ccbd450c4608e05329e974153448aaf56",
strip_prefix = "pthreadpool-76042155a8b1e189c8f141429fd72219472c32e1",
sha256 = "91c7b00c16c60c96f23d1966d524879c0f6044caf4bc5e9fc06518dda643e07e",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/Maratyszcza/pthreadpool/archive/ebd50d0cfa3664d454ffdf246fcd228c3b370a11.tar.gz",
"https://github.com/Maratyszcza/pthreadpool/archive/ebd50d0cfa3664d454ffdf246fcd228c3b370a11.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/Maratyszcza/pthreadpool/archive/76042155a8b1e189c8f141429fd72219472c32e1.tar.gz",
"https://github.com/Maratyszcza/pthreadpool/archive/76042155a8b1e189c8f141429fd72219472c32e1.tar.gz",
],
build_file = "//third_party/pthreadpool:BUILD.bazel",
)