summaryrefslogtreecommitdiff
path: root/0001-use-system-cpuinfo.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-use-system-cpuinfo.patch')
-rw-r--r--0001-use-system-cpuinfo.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/0001-use-system-cpuinfo.patch b/0001-use-system-cpuinfo.patch
new file mode 100644
index 0000000..f6f439d
--- /dev/null
+++ b/0001-use-system-cpuinfo.patch
@@ -0,0 +1,45 @@
+From 1aa74e654178dbc0258187606e52a030f2448a51 Mon Sep 17 00:00:00 2001
+From: binsz <274620705z@gmail.com>
+Date: Tue, 30 Jan 2024 23:14:27 +0800
+Subject: [PATCH] use system cpuinfo
+
+---
+ cmake/external/onnxruntime_external_deps.cmake | 8 +-------
+ cmake/onnxruntime_common.cmake | 2 +-
+ 2 files changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake
+index e338068..f78477c 100644
+--- a/cmake/external/onnxruntime_external_deps.cmake
++++ b/cmake/external/onnxruntime_external_deps.cmake
+@@ -416,13 +416,7 @@ FetchContent_Declare(
+
+
+ if (CPUINFO_SUPPORTED)
+- onnxruntime_fetchcontent_makeavailable(pytorch_cpuinfo)
+- if (pytorch_cpuinfo_SOURCE_DIR)
+- # shouldn't need to define these aliases after we use a version of cpuinfo with this commit:
+- # https://github.com/pytorch/cpuinfo/commit/082deffc80ce517f81dc2f3aebe6ba671fcd09c9
+- add_library(cpuinfo::cpuinfo ALIAS cpuinfo)
+- add_library(cpuinfo::clog ALIAS clog)
+- endif()
++ find_package(cpuinfo REQUIRED)
+ endif()
+
+
+diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake
+index 687a231..f44f4f9 100644
+--- a/cmake/onnxruntime_common.cmake
++++ b/cmake/onnxruntime_common.cmake
+@@ -208,7 +208,7 @@ if (ARM64 OR ARM OR X86 OR X64 OR X86_64)
+ # Its functionality in detecting x86 cpu features are lacking, so is support for Windows.
+ if (CPUINFO_SUPPORTED)
+ onnxruntime_add_include_to_target(onnxruntime_common cpuinfo::cpuinfo)
+- list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo cpuinfo::clog)
++ list(APPEND onnxruntime_EXTERNAL_LIBRARIES cpuinfo::cpuinfo)
+ endif()
+ endif()
+ endif()
+--
+2.41.0
+