Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "third-party/gflags"]
path = third-party/gflags
url = https://github.com/gflags/gflags.git
[submodule "backends/xnnpack/third-party/pthreadpool"]
path = backends/xnnpack/third-party/pthreadpool
url = https://github.com/Maratyszcza/pthreadpool.git
3 changes: 3 additions & 0 deletions backends/xnnpack/third-party/TARGETS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
load(":pthreadpool_defs.bzl", "define_pthreadpool")

define_pthreadpool()
1 change: 1 addition & 0 deletions backends/xnnpack/third-party/pthreadpool
Submodule pthreadpool added at a134dd
39 changes: 39 additions & 0 deletions backends/xnnpack/third-party/pthreadpool_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
def define_pthreadpool():
# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
native.cxx_library(
name = "pthreadpool",
srcs = ["pthreadpool/src/legacy-api.c", "pthreadpool/src/memory.c", "pthreadpool/src/portable-api.c", "pthreadpool/src/pthreads.c"],
deps = [
":FXdiv",
],
exported_deps = [
":pthreadpool_header",
],
compiler_flags = [
"-w",
"-Os",
"-fstack-protector-strong",
"-fno-delete-null-pointer-checks",
],
headers = {
"threadpool-atomics.h": "pthreadpool/src/threadpool-atomics.h",
"threadpool-common.h": "pthreadpool/src/threadpool-common.h",
"threadpool-object.h": "pthreadpool/src/threadpool-object.h",
"threadpool-utils.h": "pthreadpool/src/threadpool-utils.h",
},
header_namespace = "",
preferred_linkage = "static",
platform_preprocessor_flags = [["windows", ["-D_WINDOWS", "-D_WIN32", "-DWIN32", "-DNOMINMAX", "-D_CRT_SECURE_NO_WARNINGS", "-D_USE_MATH_DEFINES"]], ["windows.*64$", ["-D_WIN64"]]],
preprocessor_flags = ["-DPTHREADPOOL_USE_FUTEX=0", "-DPTHREADPOOL_USE_GCD=0"],
visibility = ["PUBLIC"],
)

# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
native.cxx_library(
name = "pthreadpool_header",
header_namespace = "",
exported_headers = {
"pthreadpool.h": "pthreadpool/include/pthreadpool.h",
},
visibility = ["PUBLIC"],
)