forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cmake flag control for cross compiling Added patch to modify mlas to make it suitable for vsinpu cross compiling Type: New Feature Signed-off-by: Feiyue Chen <[email protected]>
- Loading branch information
1 parent
46c90e3
commit 1017a12
Showing
2 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
34 changes: 34 additions & 0 deletions
34
onnxruntime/core/providers/vsinpu/patches/mlas_crosscompiliing.patch
This file contains 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,34 @@ | ||
diff --git a/cmake/onnxruntime_mlas.cmake b/cmake/onnxruntime_mlas.cmake | ||
index e0ccc504d7..6c5aa6ea53 100644 | ||
--- a/cmake/onnxruntime_mlas.cmake | ||
+++ b/cmake/onnxruntime_mlas.cmake | ||
@@ -335,7 +335,7 @@ else() | ||
${MLAS_SRC_DIR}/qgemm_kernel_udot.cpp | ||
${MLAS_SRC_DIR}/qgemm_kernel_sdot.cpp | ||
) | ||
- if (NOT APPLE) | ||
+ if (NOT APPLE AND NOT onnxruntime_USE_VSINPU) | ||
set(mlas_platform_srcs | ||
${mlas_platform_srcs} | ||
${MLAS_SRC_DIR}/aarch64/HalfGemmKernelNeon.S | ||
diff --git a/onnxruntime/core/mlas/inc/mlas.h b/onnxruntime/core/mlas/inc/mlas.h | ||
index fd6b3df934..f81f1c42b6 100644 | ||
--- a/onnxruntime/core/mlas/inc/mlas.h | ||
+++ b/onnxruntime/core/mlas/inc/mlas.h | ||
@@ -79,6 +79,7 @@ Abstract: | ||
|
||
#if (!defined(_MSC_VER)) || (_MSC_VER >= 1930) | ||
#if defined(MLAS_TARGET_ARM64) || defined(MLAS_TARGET_ARM64EC) | ||
+#if !defined(USE_VSINPU) | ||
#if !defined(__APPLE__) | ||
// Had to temporary disable fp16 under APPLE ARM64, as compiling | ||
// the source files require a hardware specific compilation flag. | ||
@@ -87,7 +88,8 @@ Abstract: | ||
|
||
#define MLAS_F16VEC_INTRINSICS_SUPPORTED | ||
|
||
-#endif // | ||
+#endif | ||
+#endif // | ||
#endif // ARM64 | ||
#endif // Visual Studio 16 or earlier does not support fp16 intrinsic |