From 1b42cb4f68bf3e3f96d609a9223653b8a0d8ba5b Mon Sep 17 00:00:00 2001 From: "d.levin256@gmail.com" Date: Mon, 26 Feb 2024 01:25:15 +0000 Subject: [PATCH] Built KFR and FFTW --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- src/benchmark.hpp | 3 ++- src/fft_benchmark.cpp | 3 +++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d2f5ce1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: Build +on: push +jobs: + linux-x86_64: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Packages + run: | + sudo apt-get update && sudo apt-get install -y wget cmake gnupg2 ninja-build build-essential unzip + - name: Build FFTW + run: | + cd "$VCPKG_INSTALLATION_ROOT" + ./vcpkg install fftw3[avx2] + ls -la "$VCPKG_INSTALLATION_ROOT/installed" + ls -la "$VCPKG_INSTALLATION_ROOT/installed/x64-linux" + ls -la "$VCPKG_INSTALLATION_ROOT/installed/x64-linux/share" + ls -la "$VCPKG_INSTALLATION_ROOT/installed/x64-linux/lib" + ls -la "$VCPKG_INSTALLATION_ROOT/installed/x64-linux/include" + - name: Get KFR6 binaries + env: + TMP_DIR: ${{ runner.temp }} + KFR_VER: 6.0.2 + run: | + curl -o "$TMP_DIR/kfr.zip" -L "https://github.com/kfrlib/kfr/releases/download/$KFR_VER/linux-x86_64.zip" + unzip "$TMP_DIR/kfr.zip" -d "${TMP_DIR}/kfr" + ls -la "${TMP_DIR}/kfr" + - name: Build benchmark + env: + TMP_DIR: ${{ runner.temp }} + run: | + cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -GNinja "-DCMAKE_PREFIX_PATH=${TMP_DIR}/kfr/lib/cmake;$VCPKG_INSTALLATION_ROOT/installed/x64-linux/share" + ninja -C build + ls -la build + file build/fft_benchmark_{fftw,kfr} + mkdir -p "${{ github.workspace }}/dist" + cp build/fft_benchmark_{fftw,kfr} "${{ github.workspace }}/dist" + - name: Binaries + uses: actions/upload-artifact@v4 + with: + name: linux-x86_64 + path: ${{ github.workspace }}/dist diff --git a/.gitignore b/.gitignore index 140ed43..16e989d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # build directory -build* +build +build/ bin/ ipp/* diff --git a/src/benchmark.hpp b/src/benchmark.hpp index d86de87..1a00e23 100644 --- a/src/benchmark.hpp +++ b/src/benchmark.hpp @@ -21,7 +21,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/src/fft_benchmark.cpp b/src/fft_benchmark.cpp index b9051c6..18ec26f 100644 --- a/src/fft_benchmark.cpp +++ b/src/fft_benchmark.cpp @@ -337,6 +337,9 @@ int main(int argc, char** argv) json_key("cpu"); json_string(cpuname); + json_key("clock_MHz"); + json_number(1000.0 / tsc_resolution()); + json_key("library"); json_string(fftname);