sfizz/benchmarks/CMakeLists.txt

101 lines
4.1 KiB
Text
Raw Normal View History

2020-02-09 13:07:28 +01:00
macro(sfizz_add_benchmark TARGET)
2021-01-31 23:23:23 +01:00
if (NOT TARGET sfizz_benchmarks)
add_custom_target(sfizz_benchmarks)
endif()
2020-12-14 07:49:02 +01:00
add_executable("${TARGET}" ${ARGN})
2021-01-31 23:23:23 +01:00
add_dependencies(sfizz_benchmarks "${TARGET}")
2020-12-14 07:49:02 +01:00
target_link_libraries("${TARGET}"
2020-12-14 14:40:19 +01:00
PRIVATE sfizz::internal sfizz::filesystem absl::span absl::algorithm
PRIVATE benchmark::benchmark benchmark::benchmark_main)
2020-12-14 07:49:02 +01:00
sfizz_enable_fast_math("${TARGET}")
2020-02-09 13:07:28 +01:00
endmacro()
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_opf_high_vs_low BM_OPF_high_vs_low.cpp)
sfizz_add_benchmark(bm_clock BM_clock.cpp)
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_write BM_writeInterleaved.cpp)
sfizz_add_benchmark(bm_read BM_readInterleaved.cpp)
sfizz_add_benchmark(bm_mathfuns BM_mathfuns.cpp)
sfizz_add_benchmark(bm_gain BM_gain.cpp)
sfizz_add_benchmark(bm_divide BM_divide.cpp)
sfizz_add_benchmark(bm_ramp BM_ramp.cpp)
if(0) #FIXME
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_ADSR BM_ADSR.cpp)
endif()
2020-02-19 12:25:03 +01:00
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_add BM_add.cpp)
sfizz_add_benchmark(bm_multiplyAdd BM_multiplyAdd.cpp)
2020-02-27 14:05:05 +01:00
sfizz_add_benchmark(bm_multiplyAddFixedGain BM_multiplyAddFixedGain.cpp)
sfizz_add_benchmark(bm_multiplyMul BM_multiplyMul.cpp)
sfizz_add_benchmark(bm_multiplyMulFixedGain BM_multiplyMulFixedGain.cpp)
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_subtract BM_subtract.cpp)
sfizz_add_benchmark(bm_copy BM_copy.cpp)
sfizz_add_benchmark(bm_mean BM_mean.cpp)
sfizz_add_benchmark(bm_meanSquared BM_meanSquared.cpp)
sfizz_add_benchmark(bm_cumsum BM_cumsum.cpp)
sfizz_add_benchmark(bm_diff BM_diff.cpp)
sfizz_add_benchmark(bm_pointerIterationOrOffsets BM_pointerIterationOrOffsets.cpp)
2020-03-07 14:05:05 +01:00
sfizz_add_benchmark(bm_maps BM_maps.cpp)
target_link_libraries(bm_maps PRIVATE absl::flat_hash_map)
2020-03-25 22:20:37 +01:00
sfizz_add_benchmark(bm_mapVsArray BM_mapVsArray.cpp)
2020-06-16 11:32:34 +02:00
sfizz_add_benchmark(bm_random BM_random.cpp)
2020-08-12 16:12:04 +02:00
sfizz_add_benchmark(bm_clamp BM_clamp.cpp)
2020-08-12 16:54:49 +02:00
sfizz_add_benchmark(bm_allWithin BM_allWithin.cpp)
if(0) #FIXME
sfizz_add_benchmark(bm_logger BM_logger.cpp)
endif()
sfizz_add_benchmark(bm_smoothers BM_smoothers.cpp)
2020-08-27 05:32:39 +02:00
sfizz_add_benchmark(bm_powerFollower BM_powerFollower.cpp)
if(SFIZZ_USE_SNDFILE)
if(TARGET sfizz::samplerate)
sfizz_add_benchmark(bm_resample BM_resample.cpp ${BENCHMARK_SIMD_SOURCES})
target_link_libraries(bm_resample PRIVATE sfizz::samplerate sfizz::sndfile sfizz::hiir)
endif()
2020-01-19 00:22:16 +01:00
endif()
2019-12-04 01:19:15 +01:00
2020-03-31 09:53:46 +02:00
sfizz_add_benchmark(bm_envelopes BM_envelopes.cpp)
2019-12-13 09:34:36 +01:00
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_wavfile BM_wavfile.cpp)
2020-12-14 08:20:01 +01:00
target_link_libraries(bm_wavfile PRIVATE sfizz::sndfile)
2019-12-21 22:05:32 +01:00
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_flacfile BM_flacfile.cpp)
2020-12-14 08:20:01 +01:00
target_link_libraries(bm_flacfile PRIVATE sfizz::sndfile)
2019-12-21 22:19:19 +01:00
if(SFIZZ_USE_SNDFILE)
sfizz_add_benchmark(bm_audioReaders BM_audioReaders.cpp ../src/sfizz/AudioReader.cpp)
target_link_libraries(bm_audioReaders PRIVATE st_audiofile sfizz::sndfile)
endif()
2020-07-26 00:48:43 +02:00
if(SFIZZ_USE_SNDFILE)
sfizz_add_benchmark(bm_readChunk BM_readChunk.cpp)
target_link_libraries(bm_readChunk PRIVATE sfizz::sndfile)
sfizz_add_benchmark(bm_readChunkFlac BM_readChunkFlac.cpp)
target_link_libraries(bm_readChunkFlac PRIVATE sfizz::sndfile)
endif()
2020-05-16 16:37:28 +02:00
sfizz_add_benchmark(bm_interpolators BM_interpolators.cpp)
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_filterModulation BM_filterModulation.cpp ../src/sfizz/SfzFilter.cpp)
2020-12-14 08:20:01 +01:00
target_link_libraries(bm_filterModulation PRIVATE sfizz::sndfile)
2020-02-07 11:11:22 +01:00
2020-02-09 13:07:28 +01:00
sfizz_add_benchmark(bm_filterStereoMono BM_filterStereoMono.cpp ../src/sfizz/SfzFilter.cpp)
2020-12-14 08:20:01 +01:00
target_link_libraries(bm_filterStereoMono PRIVATE sfizz::sndfile)
2020-02-07 11:11:22 +01:00
2020-12-14 14:40:19 +01:00
sfizz_add_benchmark(bm_stringResonator BM_stringResonator.cpp)
2020-12-14 08:20:01 +01:00
target_link_libraries(bm_stringResonator PRIVATE sfizz::sndfile)
2020-04-02 09:15:54 +02:00
2023-03-31 18:47:37 +02:00
if(PROJECT_SYSTEM_PROCESSOR MATCHES "armv7l")
sfizz_add_benchmark(bm_pan_arm BM_pan_arm.cpp ../src/sfizz/Panning.cpp)
2020-12-14 08:20:01 +01:00
target_link_libraries(bm_pan_arm PRIVATE sfizz::jsl)
endif()
configure_file("sample.wav" "${CMAKE_BINARY_DIR}/benchmarks/sample1.wav" COPYONLY)
configure_file("sample.wav" "${CMAKE_BINARY_DIR}/benchmarks/sample2.wav" COPYONLY)
configure_file("sample.wav" "${CMAKE_BINARY_DIR}/benchmarks/sample3.wav" COPYONLY)
configure_file("sample.flac" "${CMAKE_BINARY_DIR}/benchmarks/sample1.flac" COPYONLY)
configure_file("sample.flac" "${CMAKE_BINARY_DIR}/benchmarks/sample2.flac" COPYONLY)
configure_file("sample.flac" "${CMAKE_BINARY_DIR}/benchmarks/sample3.flac" COPYONLY)