-
Couldn't load subscription status.
- Fork 3.5k
Re-enable cpuinfo for ARM64EC #25863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bfe1140
fix CPUIDINFO_ARCH_ARM definition to include ARM64EC
edgchen1 0b03389
enable cpuinfo on ARM64EC builds
edgchen1 233c502
patch cpuinfo for arm64ec vcpkg support
edgchen1 215f8fd
copy patch to cmake/patches
edgchen1 bf6f036
apply patch in onnxruntime_external_deps.cmake also
edgchen1 a60bb22
rename variable
edgchen1 0ee37f8
also link to cpuinfo for arm64ec in onnxruntime_common.cmake
edgchen1 99a3d7e
remove reads of variable ONNXRUNTIME_CLOG_TARGET_NAME. it's not set a…
edgchen1 8405fe2
just check CPUINFO_SUPPORTED in onnxruntime_common.cmake
edgchen1 e19200f
check CPUINFO_SUPPORTED in device discovery test ifdef
edgchen1 1d60316
adjust patch message
edgchen1 411afd9
clean up cmake code
edgchen1 e257a4e
Merge remote-tracking branch 'origin/main' into edgchen1/enable_cpuin…
edgchen1 9aa7aab
refine cpuinfo supported check for emscripten
edgchen1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,91 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index aedc983..dab589e 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -72,6 +72,17 @@ IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND CPUINFO_TARGET_PROCESSOR STREQUAL "am | ||
| ENDIF() | ||
| IF(IS_APPLE_OS AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64.*)$") | ||
| SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}") | ||
| +ELSEIF(MSVC AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.10") | ||
| + # Use CMAKE_C_COMPILER_ARCHITECTURE_ID. MSVC values are documented as available since CMake 3.10. | ||
| + IF(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "X86") | ||
| + SET(CPUINFO_TARGET_PROCESSOR "x86") | ||
| + ELSEIF(CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "x64") | ||
| + SET(CPUINFO_TARGET_PROCESSOR "x86_64") | ||
| + ELSEIF(CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "^(ARM64|ARM64EC)$") | ||
| + SET(CPUINFO_TARGET_PROCESSOR "arm64") | ||
| + ELSE() | ||
| + MESSAGE(FATAL_ERROR "Unsupported MSVC compiler architecture ID \"${CMAKE_C_COMPILER_ARCHITECTURE_ID}\"") | ||
| + ENDIF() | ||
| ELSEIF(CMAKE_GENERATOR MATCHES "^Visual Studio " AND CMAKE_VS_PLATFORM_NAME) | ||
| IF(CMAKE_VS_PLATFORM_NAME STREQUAL "Win32") | ||
| SET(CPUINFO_TARGET_PROCESSOR "x86") | ||
| @@ -88,7 +99,7 @@ ENDIF() | ||
|
|
||
| # ---[ Build flags | ||
| SET(CPUINFO_SUPPORTED_PLATFORM TRUE) | ||
| -IF(NOT CMAKE_SYSTEM_PROCESSOR) | ||
| +IF(NOT CPUINFO_TARGET_PROCESSOR) | ||
| IF(NOT IOS) | ||
| MESSAGE(WARNING | ||
| "Target processor architecture is not specified. " | ||
| @@ -201,12 +212,12 @@ IF(CPUINFO_SUPPORTED_PLATFORM) | ||
| src/arm/linux/chipset.c | ||
| src/arm/linux/midr.c | ||
| src/arm/linux/hwcap.c) | ||
| - IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv[5-8]") | ||
| + IF(CPUINFO_TARGET_PROCESSOR MATCHES "^armv[5-8]") | ||
| LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch32-isa.c) | ||
| IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND ANDROID_ABI STREQUAL "armeabi") | ||
| SET_SOURCE_FILES_PROPERTIES(src/arm/linux/aarch32-isa.c PROPERTIES COMPILE_FLAGS -marm) | ||
| ENDIF() | ||
| - ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$") | ||
| + ELSEIF(CPUINFO_TARGET_PROCESSOR MATCHES "^(aarch64|arm64)$") | ||
| LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch64-isa.c) | ||
| ENDIF() | ||
| ELSEIF(IS_APPLE_OS AND CPUINFO_TARGET_PROCESSOR MATCHES "arm64.*") | ||
| @@ -395,7 +406,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS) | ||
| TARGET_COMPILE_DEFINITIONS(cpuinfo_mock PRIVATE _GNU_SOURCE=1) | ||
| ENDIF() | ||
|
|
||
| - IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a)$") | ||
| + IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CPUINFO_TARGET_PROCESSOR MATCHES "^(armv5te|armv7-a)$") | ||
| ADD_EXECUTABLE(atm7029b-tablet-test test/mock/atm7029b-tablet.cc) | ||
| TARGET_INCLUDE_DIRECTORIES(atm7029b-tablet-test BEFORE PRIVATE test/mock) | ||
| TARGET_LINK_LIBRARIES(atm7029b-tablet-test PRIVATE cpuinfo_mock gtest) | ||
| @@ -577,7 +588,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS) | ||
| ADD_TEST(NAME xperia-sl-test COMMAND xperia-sl-test) | ||
| ENDIF() | ||
|
|
||
| - IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a|aarch64)$") | ||
| + IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CPUINFO_TARGET_PROCESSOR MATCHES "^(armv5te|armv7-a|aarch64)$") | ||
| ADD_EXECUTABLE(alcatel-revvl-test test/mock/alcatel-revvl.cc) | ||
| TARGET_INCLUDE_DIRECTORIES(alcatel-revvl-test BEFORE PRIVATE test/mock) | ||
| TARGET_LINK_LIBRARIES(alcatel-revvl-test PRIVATE cpuinfo_mock gtest) | ||
| @@ -774,7 +785,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS) | ||
| ADD_TEST(NAME xperia-c4-dual-test COMMAND xperia-c4-dual-test) | ||
| ENDIF() | ||
|
|
||
| - IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") | ||
| + IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CPUINFO_TARGET_PROCESSOR MATCHES "^(i686|x86_64)$") | ||
| ADD_EXECUTABLE(alldocube-iwork8-test test/mock/alldocube-iwork8.cc) | ||
| TARGET_INCLUDE_DIRECTORIES(alldocube-iwork8-test BEFORE PRIVATE test/mock) | ||
| TARGET_LINK_LIBRARIES(alldocube-iwork8-test PRIVATE cpuinfo_mock gtest) | ||
| @@ -831,7 +842,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS) | ||
| ADD_TEST(NAME brand-string-test COMMAND brand-string-test) | ||
| ENDIF() | ||
|
|
||
| - IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv[5-8].*|aarch64)$") | ||
| + IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CPUINFO_TARGET_PROCESSOR MATCHES "^(armv[5-8].*|aarch64)$") | ||
| ADD_LIBRARY(android_properties_interface STATIC test/name/android-properties-interface.c) | ||
| CPUINFO_TARGET_ENABLE_C99(android_properties_interface) | ||
| CPUINFO_TARGET_RUNTIME_LIBRARY(android_properties_interface) | ||
| @@ -879,7 +890,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_TOOLS) | ||
| TARGET_LINK_LIBRARIES(cache-info PRIVATE cpuinfo) | ||
| INSTALL(TARGETS cache-info RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
|
||
| - IF(CMAKE_SYSTEM_NAME MATCHES "^(Android|Linux)$" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv[5-8].*|aarch64)$") | ||
| + IF(CMAKE_SYSTEM_NAME MATCHES "^(Android|Linux)$" AND CPUINFO_TARGET_PROCESSOR MATCHES "^(armv[5-8].*|aarch64)$") | ||
| ADD_EXECUTABLE(auxv-dump tools/auxv-dump.c) | ||
| CPUINFO_TARGET_ENABLE_C99(auxv-dump) | ||
| CPUINFO_TARGET_RUNTIME_LIBRARY(auxv-dump) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.