Skip to content

Commit

Permalink
chore: tune compile options
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Oct 7, 2024
1 parent 4a0b2ce commit 64abb77
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,32 @@ jobs:
if [[ "$PLATFORM" == "windows" ]]; then
EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-w64-${ARCH}.clang.toolchain.cmake"
if [[ "$ARCH" == "aarch64" ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DEXECUTORCH_BUILD_QNN=ON"
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DEXECUTORCH_BUILD_QNN=ON -DQNN_SDK_ROOT=$QNN_SDK_ROOT"
fi
elif [[ "$PLATFORM" == "macos" ]]; then
EXTRA_CMAKE_ARGS="-DEXECUTORCH_BUILD_COREML=ON -DCMAKE_OSX_ARCHITECTURES=${ARCH}"
elif [[ "$PLATFORM" == "linux" ]] && [[ "$ARCH" == "aarch64" ]]; then
EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=../cmake/aarch64-linux-gnu.gcc.toolchain.cmake"
fi
if [[ "$ARCH" == "aarch64" ]]; then
EXTRA_CMAKE_ARGS="$EXTRA_CMAKE_ARGS -DEXECUTORCH_XNNPACK_ENABLE_KLEIDI=ON"
fi
cmake \
-S . \
-B cmake-out \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=cmake-out \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
-DEXECUTORCH_BUILD_KERNELS_CUSTOM=ON \
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
-DQNN_SDK_ROOT=$QNN_SDK_ROOT \
-DEXECUTORCH_BUILD_PTHREADPOOL=ON \
-DEXECUTORCH_BUILD_CPUINFO=ON \
-DEXECUTORCH_BUILD_XNNPACK=ON \
-DEXECUTORCH_BUILD_PTHREADPOOL=ON \
-DEXECUTORCH_BUILD_SDK=ON \
-DEXECUTORCH_ENABLE_LOGGING=ON \
-DEXECUTORCH_XNNPACK_SHARED_WORKSPACE=ON \
$EXTRA_CMAKE_ARGS
cmake --build cmake-out --target install --config Release -j$(nproc)
fi
Expand Down
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ fn main() {
// XNNPACK
if link_lib(&lib_path, "xnnpack_backend", true).is_ok() {
assert!(link_lib(&lib_path, "XNNPACK", false).is_ok());
let _ = link_lib(&lib_path, "microkernels-prod", false);
assert!(link_lib(&lib_path, "microkernels-prod", false).is_ok());
let _ = link_lib(&lib_path, "kleidiai", false);
}

// Vulkan
Expand Down
8 changes: 3 additions & 5 deletions cmake/mingw-w64-aarch64.clang.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ set(CMAKE_RANLIB aarch64-w64-mingw32-ranlib)
set(CMAKE_STRIP aarch64-w64-mingw32-strip)
set(CMAKE_LINKER aarch64-w64-mingw32-ld)

set(CMAKE_C_FLAGS "-march=armv8.4-a")
set(CMAKE_CXX_FLAGS "-march=armv8.4-a")
set(arch_c_flags "-march=armv8.7-a")

# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")
set( CMAKE_C_FLAGS_INIT "${arch_c_flags}" )
set( CMAKE_CXX_FLAGS_INIT "${arch_c_flags}" )

0 comments on commit 64abb77

Please sign in to comment.