File tree Expand file tree Collapse file tree 4 files changed +35
-6
lines changed
java/src/main/java/ai/onnxruntime
onnxruntime/core/mlas/lib/aarch64 Expand file tree Collapse file tree 4 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,31 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Android")
100100 file (MAKE_DIRECTORY ${ANDROID_PACKAGE_OUTPUT_DIR} )
101101endif ()
102102
103- # Set platform and ach for packaging
103+ # Set platform and arch for packaging
104+ # Checks the names set by MLAS on non-Windows platforms first
104105if (CMAKE_SYSTEM_NAME STREQUAL "Android" )
105106 set (JNI_ARCH ${ANDROID_ABI} )
106- elseif (CMAKE_SIZEOF_VOID_P EQUAL "8" )
107+ elseif (ARM64)
108+ set (JNI_ARCH aarch64)
109+ elseif (X86_64)
107110 set (JNI_ARCH x64)
111+ elseif (POWER)
112+ set (JNI_ARCH ppc64)
108113else ()
109- message (FATAL_ERROR "Java is currently not supported for x86 architecture" )
114+ # Now mirror the checks used with MSVC
115+ if (MSVC )
116+ if (onnxruntime_target_platform STREQUAL "ARM64" )
117+ set (JNI_ARCH aarch64)
118+ elseif (onnxruntime_target_platform STREQUAL "x64" )
119+ set (JNI_ARCH x64)
120+ else ()
121+ # if everything else failed then we're on a 32-bit arch and Java isn't supported
122+ message (FATAL_ERROR "Java is currently not supported on 32-bit x86 architecture" )
123+ endif ()
124+ else ()
125+ # if everything else failed then we're on a 32-bit arch and Java isn't supported
126+ message (FATAL_ERROR "Java is currently not supported on 32-bit x86 architecture" )
127+ endif ()
110128endif ()
111129
112130if (WIN32 )
Original file line number Diff line number Diff line change @@ -151,7 +151,9 @@ else()
151151 OUTPUT_VARIABLE dumpmachine_output
152152 ERROR_QUIET
153153 )
154- if (dumpmachine_output MATCHES "^arm.*" )
154+ if (dumpmachine_output MATCHES "^arm64.*" )
155+ set (ARM64 TRUE )
156+ elseif (dumpmachine_output MATCHES "^arm.*" )
155157 set (ARM TRUE )
156158 elseif (dumpmachine_output MATCHES "^aarch64.*" )
157159 set (ARM64 TRUE )
Original file line number Diff line number Diff line change @@ -59,10 +59,15 @@ private static String initOsArch() {
5959 }
6060 String detectedArch = null ;
6161 String arch = System .getProperty ("os.arch" , "generic" ).toLowerCase (Locale .ENGLISH );
62- if (arch .indexOf ("amd64" ) == 0 || arch .indexOf ("x86_64" ) == 0 ) {
62+ if (arch .startsWith ("amd64" ) || arch .startsWith ("x86_64" )) {
6363 detectedArch = "x64" ;
64- } else if (arch .indexOf ("x86" ) == 0 ) {
64+ } else if (arch .startsWith ("x86" )) {
65+ // 32-bit x86 is not supported by the Java API
6566 detectedArch = "x86" ;
67+ } else if (arch .startsWith ("aarch64" )) {
68+ detectedArch = "aarch64" ;
69+ } else if (arch .startsWith ("ppc64" )) {
70+ detectedArch = "ppc64" ;
6671 } else if (isAndroid ()) {
6772 detectedArch = arch ;
6873 } else {
Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ Abstract:
2323
2424 . equ .LGemmU8X8KernelFrame_ColumnSumBuffer , 0
2525 . equ .LGemmU8X8KernelFrame_DepthValue , 8
26+ #if defined(__APPLE__)
27+ . equ .LGemmU8X8KernelFrame_ZeroMode , 12
28+ #else
2629 . equ .LGemmU8X8KernelFrame_ZeroMode , 16
30+ #endif
2731
2832 .text
2933
You can’t perform that action at this time.
0 commit comments