From 6809b1797f8d72536103092eb914c7e32af0b91c Mon Sep 17 00:00:00 2001 From: Park DongHa Date: Wed, 27 Sep 2023 22:48:30 +0900 Subject: [PATCH] [cpuinfo,pthreadpool,xnnpack] update for future works (#114) * [pthreadpool] create a new port * support uwp build * [pthreadpool] update baseline * [cpuinfo] update to latest * [cpuinfo] update baseline * [xnnpack] update to 2023-04-13 * [xnnpack] update baseline * add dropped files --- ports/cpuinfo/portfile.cmake | 6 ++---- ports/cpuinfo/vcpkg.json | 2 +- ports/pthreadpool/fix-cmake-uwp.patch | 13 +++++++++++++ ports/pthreadpool/portfile.cmake | 22 ++++++++++++++++++++++ ports/pthreadpool/vcpkg.json | 16 ++++++++++++++++ ports/xnnpack/fix-cmake.patch | 9 +++++---- ports/xnnpack/portfile.cmake | 6 ++++-- ports/xnnpack/vcpkg.json | 4 +--- versions/baseline.json | 10 +++++++--- versions/c-/cpuinfo.json | 5 +++++ versions/p-/pthreadpool.json | 9 +++++++++ versions/x-/xnnpack.json | 5 +++++ 12 files changed, 90 insertions(+), 17 deletions(-) create mode 100644 ports/pthreadpool/fix-cmake-uwp.patch create mode 100644 ports/pthreadpool/portfile.cmake create mode 100644 ports/pthreadpool/vcpkg.json create mode 100644 versions/p-/pthreadpool.json diff --git a/ports/cpuinfo/portfile.cmake b/ports/cpuinfo/portfile.cmake index a03791ad..f86df229 100644 --- a/ports/cpuinfo/portfile.cmake +++ b/ports/cpuinfo/portfile.cmake @@ -6,11 +6,9 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO pytorch/cpuinfo - REF eb4a6674bfe9cf91b63b9817412ae5f6862c8432 - SHA512 2b8bca09c140ad5d3c7c42d4a117642bad8ec1644085c20876006575428db756c11a1ffaaa24788b43020fc0822ca56695e6969c8a946070aafee93d2f7a66a3 + REF 959002f82d7962a473d8bf301845f2af720e0aa4 + SHA512 9aedaac08493e67d339fdffd430f39b2f3a2bf231d0454b9e5193a2c22b51fe728e89ea6066a2915a718b27c0741471f27489e1ea6f36c01dec59ea2c499eeb5 HEAD_REF main - PATCHES - build-clog.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/cpuinfo/vcpkg.json b/ports/cpuinfo/vcpkg.json index e5cce2a6..f66f7b60 100644 --- a/ports/cpuinfo/vcpkg.json +++ b/ports/cpuinfo/vcpkg.json @@ -1,6 +1,6 @@ { "name": "cpuinfo", - "version-date": "2023-03-19", + "version-date": "2023-09-12", "description": "CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)", "homepage": "https://github.com/pytorch/cpuinfo", "license": "BSD-2-Clause", diff --git a/ports/pthreadpool/fix-cmake-uwp.patch b/ports/pthreadpool/fix-cmake-uwp.patch new file mode 100644 index 00000000..41fd40d1 --- /dev/null +++ b/ports/pthreadpool/fix-cmake-uwp.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7fa4285..35b2eee 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -80,7 +80,7 @@ ELSE() + LIST(APPEND PTHREADPOOL_SRCS src/portable-api.c src/memory.c) + IF(APPLE AND (PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "default" OR PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "gcd")) + LIST(APPEND PTHREADPOOL_SRCS src/gcd.c) +- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$" AND (PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "default" OR PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "event")) ++ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|WindowsStore|CYGWIN|MSYS)$" AND (PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "default" OR PTHREADPOOL_SYNC_PRIMITIVE STREQUAL "event")) + LIST(APPEND PTHREADPOOL_SRCS src/windows.c) + ELSE() + LIST(APPEND PTHREADPOOL_SRCS src/pthreads.c) diff --git a/ports/pthreadpool/portfile.cmake b/ports/pthreadpool/portfile.cmake new file mode 100644 index 00000000..030faa67 --- /dev/null +++ b/ports/pthreadpool/portfile.cmake @@ -0,0 +1,22 @@ +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Maratyszcza/pthreadpool + REF 4fe0e1e183925bf8cfa6aae24237e724a96479b8 + SHA512 764d81219f2bf1f056983b5c2576f377aeef37f0f2282e74f81bfe1eac5353e175603f80a6647c96165b24ebdcb7bc2189a376e8577ce4319d82679c33750451 + PATCHES fix-cmake-uwp.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DPTHREADPOOL_BUILD_TESTS=OFF + -DPTHREADPOOL_BUILD_BENCHMARKS=OFF +) +vcpkg_cmake_install() + +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/pthreadpool/vcpkg.json b/ports/pthreadpool/vcpkg.json new file mode 100644 index 00000000..38d809fb --- /dev/null +++ b/ports/pthreadpool/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "pthreadpool", + "version-date": "2023-09-12", + "description": "Portable (POSIX/Windows/Emscripten) thread pool for C/C++", + "homepage": "https://github.com/Maratyszcza/pthreadpool", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/ports/xnnpack/fix-cmake.patch b/ports/xnnpack/fix-cmake.patch index c9856b72..0929784f 100644 --- a/ports/xnnpack/fix-cmake.patch +++ b/ports/xnnpack/fix-cmake.patch @@ -40,13 +40,14 @@ index 2e7f753..b33f03d 100644 IF(NOT XNNPACK_USE_SYSTEM_LIBS) SET(CPUINFO_BUILD_TOOLS OFF CACHE BOOL "") SET(CPUINFO_BUILD_UNIT_TESTS OFF CACHE BOOL "") -@@ -843,7 +845,9 @@ IF(XNNPACK_BUILD_LIBRARY) +@@ -843,7 +845,10 @@ IF(XNNPACK_BUILD_LIBRARY) ENDIF() # ---[ Configure pthreadpool -IF(NOT TARGET pthreadpool) -+find_package(unofficial-pthreadpool CONFIG REQUIRED) -+add_library(pthreadpool ALIAS unofficial::pthreadpool) ++find_path(PTHREADPOOL_INCLUDE_DIRS "pthreadpool.h" REQUIRED) ++include_directories(${PTHREADPOOL_INCLUDE_DIRS}) ++find_library(PTHREADPOOL_LIBRARY NAMES pthreadpool REQUIRED) +IF(FALSE) IF(NOT XNNPACK_USE_SYSTEM_LIBS) SET(PTHREADPOOL_BUILD_TESTS OFF CACHE BOOL "") @@ -56,7 +57,7 @@ index 2e7f753..b33f03d 100644 TARGET_LINK_LIBRARIES(packing PRIVATE pthreadpool) IF(XNNPACK_BUILD_LIBRARY) - TARGET_LINK_LIBRARIES(XNNPACK PUBLIC pthreadpool) -+ TARGET_LINK_LIBRARIES(XNNPACK PRIVATE pthreadpool) ++ TARGET_LINK_LIBRARIES(XNNPACK PRIVATE ${PTHREADPOOL_LIBRARY}) TARGET_LINK_LIBRARIES(allocator PRIVATE pthreadpool) TARGET_LINK_LIBRARIES(cache PRIVATE memory pthreadpool) TARGET_LINK_LIBRARIES(subgraph PRIVATE pthreadpool) diff --git a/ports/xnnpack/portfile.cmake b/ports/xnnpack/portfile.cmake index 331644a7..808bcf7e 100644 --- a/ports/xnnpack/portfile.cmake +++ b/ports/xnnpack/portfile.cmake @@ -2,11 +2,13 @@ if(VCPKG_TARGET_IS_WINDOWS) vcpkg_check_linkage(ONLY_STATIC_LIBRARY) endif() +# for onnxruntime, using just before https://github.com/google/XNNPACK/commit/142aceb06d509b57d02ddc2a9558ab35eacbb6fb + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/XNNPACK - REF bad81856dce9fea265866c87ea524afbbdd69012 # 2023-03-19 - SHA512 eed30cc207639a32fe247f979de33c3600abbd46f98b367eaf88e4f17453ce30464cafff237eb742832411502f068af7a79f12c547ad00bc179f2972444da0d0 + REF db68602a37353f3050c1835d5609a1ce1a3f3d2a # 2023-04-13 + SHA512 66d8546678fb268e75b318cff997d24748db49447df2ec0c2fec7a4c6a0bdb3d985d25df18c6eb85aec8a66627b62e41c02c584c3b7ee7d631fb95b42aee074b HEAD_REF master PATCHES fix-cmake.patch diff --git a/ports/xnnpack/vcpkg.json b/ports/xnnpack/vcpkg.json index 3f20498b..76d75220 100644 --- a/ports/xnnpack/vcpkg.json +++ b/ports/xnnpack/vcpkg.json @@ -1,13 +1,11 @@ { "name": "xnnpack", - "version-date": "2023-03-19", - "port-version": 1, + "version-date": "2023-04-13", "description": "High-efficiency floating-point neural network inference operators for mobile, server, and Web", "homepage": "https://github.com/google/XNNPACK", "dependencies": [ "cpuinfo", "fp16", - "fxdiv", "pthreadpool", { "name": "vcpkg-cmake", diff --git a/versions/baseline.json b/versions/baseline.json index 3f9a17e1..50a46811 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -17,7 +17,7 @@ "port-version": 2 }, "cpuinfo": { - "baseline": "2023-03-19", + "baseline": "2023-09-12", "port-version": 0 }, "directml": { @@ -84,6 +84,10 @@ "baseline": "3.1.2", "port-version": 0 }, + "pthreadpool": { + "baseline": "2023-09-12", + "port-version": 0 + }, "ruy": { "baseline": "2022-09-12", "port-version": 0 @@ -105,8 +109,8 @@ "port-version": 0 }, "xnnpack": { - "baseline": "2023-03-19", - "port-version": 1 + "baseline": "2023-04-13", + "port-version": 0 }, "xnvctrl": { "baseline": "515.43.04", diff --git a/versions/c-/cpuinfo.json b/versions/c-/cpuinfo.json index 8cab3282..1c8e5cf7 100644 --- a/versions/c-/cpuinfo.json +++ b/versions/c-/cpuinfo.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f3cd834cda6172defea6f895cab5cfb3c14e5575", + "version-date": "2023-09-12", + "port-version": 0 + }, { "git-tree": "4f5344fbf5c6a3c3cbf6235b90a910fab8f41699", "version-date": "2023-03-19", diff --git a/versions/p-/pthreadpool.json b/versions/p-/pthreadpool.json new file mode 100644 index 00000000..b1db77da --- /dev/null +++ b/versions/p-/pthreadpool.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "25cedef8cdfa7dff81489f4133c7571ed6b906c4", + "version-date": "2023-09-12", + "port-version": 0 + } + ] +} diff --git a/versions/x-/xnnpack.json b/versions/x-/xnnpack.json index 776388cd..63a8f852 100644 --- a/versions/x-/xnnpack.json +++ b/versions/x-/xnnpack.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0b5f7dd7067bc8a77c929fee398177748dbc1e8d", + "version-date": "2023-04-13", + "port-version": 0 + }, { "git-tree": "f037a2f398e6f417dddf87e832810c260c14e92d", "version-date": "2023-03-19",