Skip to content

Commit a1a5bae

Browse files
Enable JAVA API build for LoongArch64 (microsoft#25694)
### Description - Trivial changes to support LoongArch Java API build ### Motivation and Context - ONNX Runtime already supports LoongArch, but the Java API requires some trivial changes to enable it.
1 parent 2c60106 commit a1a5bae

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cmake/onnxruntime_java.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ elseif (X86_64)
110110
set(JNI_ARCH x64)
111111
elseif (POWER)
112112
set(JNI_ARCH ppc64)
113+
elseif (LOONGARCH64)
114+
set(JNI_ARCH loongarch64)
113115
else()
114116
# Now mirror the checks used with MSVC
115117
if(MSVC)

java/src/main/java/ai/onnxruntime/OnnxRuntime.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ private static String initOsArch() {
140140
detectedArch = "aarch64";
141141
} else if (arch.startsWith("ppc64")) {
142142
detectedArch = "ppc64";
143+
} else if (arch.startsWith("loongarch64")) {
144+
detectedArch = "loongarch64";
143145
} else if (isAndroid()) {
144146
detectedArch = arch;
145147
} else {

0 commit comments

Comments
 (0)