Improve OpenMP acceleration support, enable KissFFT OpenMP, and add build documentation (#601) - #865
Open
samerzumot wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses #601 ("Performance tunning").
This PR focuses on the OpenMP performance and compilation subtasks outlined in #601:
Summary of Improvements
Enable OpenMP Parallel Execution in KissFFT (
src/data_handler/build.cmake):-DUSE_OPENMP=ON/tools/build.py --use-openmp),src/data_handler/build.cmakepreviously did not passKISSFFT_OPENMP=ONto KissFFT. KissFFT was always built in single-threaded mode even when OpenMP was explicitly requested.USE_OPENMPautomatically setsKISSFFT_OPENMP ON, enabling multi-threaded radix butterfly calculations in KissFFT (kiss_fft.c).Modernize KissFFT OpenMP Compiler Configuration (
third_party/kissfft/build.cmake):third_party/kissfft/build.cmaketo leverage CMake's standardOpenMP::OpenMP_Ctarget, properly configuring compiler flags, include paths, and runtime libraries across GCC, Clang, AppleClang, and MSVC.GNU|Clang|AppleClangcheck, causing MSVC OpenMP builds to fail.macOS OpenMP Discovery & Native Architecture Support (
CMakeLists.txt&tools/build.py):libompas a keg-only package.CMakeLists.txtnow automatically detects Homebrew'slibomppath (/opt/homebrew/opt/libompor/usr/local/opt/libomp) ifOpenMP_ROOTis not explicitly provided.tools/build.py --use-openmpon macOS, the default architecture is automatically adjusted to the native machine architecture (arm64on Apple Silicon,x86_64on Intel) to match Homebrew's single-architecture bottle, enabling smooth out-of-the-box OpenMP builds without manual configuration flags.Comprehensive OpenMP Build Documentation (
docs/BuildBrainFlow.rst):docs/BuildBrainFlow.rstdetailing:libomp-dev/libgomp), macOS (brew install libomp), and Windows (MSVC built-in).tools/build.py --use-openmpand direct CMake invocation.Verification
cmake -B build_test -DUSE_OPENMP=ONandcmake --build build_test --target kissfft DataHandleron macOS (AppleClang 17 + Homebrew libomp 23.1).python3 tools/build.py --use-openmpend-to-end build and installation.cmake -B build_test_default && cmake --build build_test_default --target DataHandler).