Skip to content

Commit

Permalink
Added aarch64-linux bfloat16/float16 cmake patch
Browse files Browse the repository at this point in the history
  • Loading branch information
stemann committed Feb 11, 2025
1 parent 3ecda16 commit 478ac7a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 5555fa692e..db6d3195ea 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -671,16 +671,6 @@ else()
endif()
endif()
check_function_exists(reallocarray HAS_REALLOCARRAY)
- if (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND onnxruntime_target_platform STREQUAL "aarch64")
- check_cxx_compiler_flag(-march=armv8.2-a+bf16 HAS_ARM64_BFLOAT16)
- if(NOT HAS_ARM64_BFLOAT16)
- message(FATAL_ERROR "The compiler doesn't support BFLOAT16!!!")
- endif()
- check_cxx_compiler_flag(-march=armv8.2-a+fp16 HAS_ARM64_FLOAT16)
- if(NOT HAS_ARM64_FLOAT16)
- message(FATAL_ERROR "The compiler doesn't support FLOAT16!!!")
- endif()
- endif()
if (HAS_TAUTOLOGICAL_POINTER_COMPARE)
#we may have extra null pointer checkings in debug build, it's not an issue
list(APPEND ORT_WARNING_FLAGS -Wno-tautological-pointer-compare)
4 changes: 4 additions & 0 deletions O/ONNXRuntime/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using Pkg

sources = AbstractSource[
GitSource("https://github.com/microsoft/onnxruntime.git", "26250ae74d2c9a3c6860625ba4a147ddfb936907"),
DirectorySource(joinpath(@__DIR__, "bundled")),
]

script = raw"""
Expand Down Expand Up @@ -44,6 +45,9 @@ if [[ $target != *-w64-mingw32* ]]; then
fi
cd onnxruntime
atomic_patch -p1 ../patches/aarch64-linux-bfloat16-float16-cmake.patch
git submodule update --init --recursive --depth 1 --jobs $nproc
mkdir build
cd build
Expand Down

0 comments on commit 478ac7a

Please sign in to comment.