The table below lists the benchmark cases at the operation level.
Name | Build Target | Introduction |
---|---|---|
Biquad Op | ninja dap-op-biquad-benchmark |
This benchmark evaluates the efficiency of scalar implementation of the Biquad operator and verifies their accuracy against KFR's biquad function. The benchmark options can be configured in this file. |
Note: The vectorized implementation of the biquad filter is the same as the IIR operator. Please refer to the 'IIR Op' for details. | ||
FFT Op | ninja dap-op-fft-benchmark |
Task in TODO list. Check the benchmark in this file. |
FIR Op | ninja dap-op-fir-benchmark |
This benchmark evaluates the efficiency of both scalar and vectorized implementation of the FIR operator and verifies their accuracy against KFR's FIR function. The benchmark options can be configured in this file. |
IIR Op | ninja dap-op-iir-benchmark |
This benchmark evaluates the efficiency of both scalar and vectorized implementations of the IIR operator and verifies their accuracy against KFR's IIR function. The benchmark options can be configured in this file. |
RFFT Op | ninja dap-op-rfft-benchmark |
This benchmark evaluates the efficiency of the RFFT operator and verifies its correctness by comparing it with the RFFT function in numpy. The benchmark size can be adjusted in this file. And you can compare the time consumption with Numpy library in the numpyTimeResult.txt . |
- Set KFR library:
$ cd buddy-benchmark
$ git submodule update --init ./thirdparty/kfr
- Build benchmark for local platform:
$ cd ../buddy-mlir/build
$ export BUDDY_MLIR_BUILD_DIR=$PWD
$ export LLVM_MLIR_BUILD_DIR=$PWD/../llvm/build
$ cd ../../buddy-benchmark
$ mkdir build && cd build
$ cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=RELEASE \
-DAUDIO_PROCESSING_BENCHMARKS=ON \
-DCMAKE_CXX_COMPILER=${LLVM_MLIR_BUILD_DIR}/bin/clang++ \
-DKFR_DIR=$PWD/../thirdparty/kfr \
-DBUDDY_MLIR_BUILD_DIR=${BUDDY_MLIR_BUILD_DIR}
$ ninja <target benchmark>
// For example:
$ ninja dap-op-iir-benchmark
- Run the benchmark on your local platform:
// For example:
$ cd bin
$ ./dap-op-iir-benchmark
- Install required packages:
To help visualize the results of audio processing, we provide a tool for figure plotting. To use this tool, ensure that you are running Python3
and have the necessary packages installed: NumPy
, Matplotlib
and SciPy
. You can install them using the following command:
$ pip install numpy matplotlib scipy
- Build benchmark for local platform:
You can customize the Python3
path during the build process by
adding the option -DPYTHON_BINARY_DIR=/PATH/TO/PYTHON/BIN
as follows:
$ cd build
$ cmake -G Ninja .. \
-DAUDIO_PROCESSING_BENCHMARKS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DKFR_DIR=/PATH/TO/KFR/SOURCE/CODE \
-DBUDDY_MLIR_BUILD_DIR=/PATH/TO/BUDDY-MLIR/BUILD \
-DPYTHON_BINARY_DIR=/PATH/TO/PYTHON/BIN/
$ ninja audio-plot
- Run
audio-plot
on your local platform:
Once the processing is complete, you can use this tool to plot a comparision figure:
$ cd bin
$ ./audio-plot ../../benchmarks/AudioProcessing/Audios/NASA_Mars.wav ResultKFRIir.wav
The result is saved in bin/res.png
. For additional usage details, run audio-plot -h
to view the help information.