Toolchain cleanups

This commit is contained in:
paulfd 2019-08-30 15:48:03 +02:00
parent 1df16518c1
commit 0a6171da2e
18 changed files with 66 additions and 22 deletions

View file

@ -71,13 +71,17 @@ target_include_directories(readerwriterqueue INTERFACE "external/readerwriterque
add_subdirectory(sfizz)
add_subdirectory(clients)
if (SFIZZ_TESTS)
# Tests
add_subdirectory(external/Catch2 EXCLUDE_FROM_ALL)
add_subdirectory(external/cnpy EXCLUDE_FROM_ALL)
add_subdirectory(tests)
endif()
if (SFIZZ_BENCHMARKS)
# Benchmarks
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable Google Benchmark tests")
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable Google Benchmark install")
add_subdirectory(external/benchmark EXCLUDE_FROM_ALL)
add_subdirectory(benchmarks)
add_subdirectory(benchmarks)
endif()

View file

@ -22,7 +22,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <benchmark/benchmark.h>
#include "../sources/ADSREnvelope.h"
#include "../sfizz/ADSREnvelope.h"
#include <algorithm>
#include <random>
#include <numeric>
@ -35,7 +35,7 @@ constexpr int release = attack;
constexpr int releaseTime = envelopeSize - static_cast<int>(envelopeSize / 4);
// Explicitely instantiate class
#include "../sources/ADSREnvelope.cpp"
#include "../sfizz/ADSREnvelope.cpp"
template class sfz::ADSREnvelope<float>;
static void Point(benchmark::State& state) {

View file

@ -27,7 +27,7 @@
#include <vector>
#include <cmath>
#include <iostream>
#include "../sources/SIMDHelpers.h"
#include "../sfizz/SIMDHelpers.h"
class AddArray : public benchmark::Fixture {
public:

View file

@ -22,8 +22,8 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <benchmark/benchmark.h>
#include "../sources/SIMDHelpers.h"
#include "../sources/Buffer.h"
#include "../sfizz/SIMDHelpers.h"
#include "../sfizz/Buffer.h"
#include <algorithm>
#include <random>
#include <numeric>

View file

@ -27,7 +27,7 @@
#include <vector>
#include <cmath>
#include <iostream>
#include "../sources/SIMDHelpers.h"
#include "../sfizz/SIMDHelpers.h"
class GainSingle : public benchmark::Fixture {
public:

View file

@ -26,7 +26,7 @@
#include <random>
#include <numeric>
#include <absl/algorithm/container.h>
#include "../sources/SIMDHelpers.h"
#include "../sfizz/SIMDHelpers.h"
// In this one we have an array of indices

View file

@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../sources/SIMDHelpers.h"
#include "../sfizz/SIMDHelpers.h"
#include "absl/types/span.h"
#include <benchmark/benchmark.h>
#include <cmath>

View file

@ -23,8 +23,8 @@
#include <benchmark/benchmark.h>
#include <random>
#include "../sources/SIMDHelpers.h"
#include "../sources/Buffer.h"
#include "../sfizz/SIMDHelpers.h"
#include "../sfizz/Buffer.h"
static void Dummy(benchmark::State& state) {

View file

@ -22,8 +22,8 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <benchmark/benchmark.h>
#include "../sources/SIMDHelpers.h"
#include "../sources/Buffer.h"
#include "../sfizz/SIMDHelpers.h"
#include "../sfizz/Buffer.h"
#include <algorithm>
#include <numeric>
#include <absl/types/span.h>

View file

@ -26,7 +26,7 @@
#include <random>
#include <numeric>
#include <absl/algorithm/container.h>
#include "../sources/SIMDHelpers.h"
#include "../sfizz/SIMDHelpers.h"
// In this one we have an array of indices

View file

@ -22,8 +22,8 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <benchmark/benchmark.h>
#include "../sources/SIMDHelpers.h"
#include "../sources/Buffer.h"
#include "../sfizz/SIMDHelpers.h"
#include "../sfizz/Buffer.h"
#include <algorithm>
#include <numeric>
#include <absl/types/span.h>

View file

@ -1,5 +1,29 @@
project(sfizz)
# Check SIMD
include(CheckIncludeFiles)
CHECK_INCLUDE_FILES(x86intrin.h HAVE_X86INTRIN_H)
CHECK_INCLUDE_FILES(intrin.h HAVE_INTRIN_H)
CHECK_INCLUDE_FILES(arm_neon.h HAVE_ARM_NEON_H)
# SIMD checks
if (HAVE_X86INTRIN_H AND UNIX)
add_compile_options(-DHAVE_X86INTRIN_H)
set(SFIZZ_SIMD_SOURCES ../sfizz/SIMDSSE.cpp)
elseif (HAVE_INTRIN_H AND WIN32)
add_compile_options(/DHAVE_INTRIN_H)
set(SFIZZ_SIMD_SOURCES ../sfizz/SIMDSSE.cpp)
elseif (HAVE_ARM_NEON_H AND UNIX)
add_compile_options(-DHAVE_ARM_NEON_H)
add_compile_options(-mfpu=neon-fp-armv8)
add_compile_options(-march=native)
add_compile_options(-mtune=cortex-a53)
add_compile_options(-funsafe-math-optimizations)
set(SFIZZ_SIMD_SOURCES ../sfizz/SIMDNEON.cpp)
else()
set(SFIZZ_SIMD_SOURCES ../sfizz/SIMDDummy.cpp)
endif()
add_executable(bm_opf_high_vs_low BM_OPF_high_vs_low.cpp)
target_link_libraries(bm_opf_high_vs_low benchmark absl::span)
@ -31,4 +55,19 @@ add_executable(bm_ADSR BM_ADSR.cpp ${SFIZZ_SIMD_SOURCES})
target_link_libraries(bm_ADSR benchmark absl::span absl::algorithm)
add_executable(bm_add BM_add.cpp ${SFIZZ_SIMD_SOURCES})
target_link_libraries(bm_add benchmark absl::span absl::algorithm)
target_link_libraries(bm_add benchmark absl::span absl::algorithm)
add_custom_target(sfizz_benchmarks)
add_dependencies(sfizz_benchmarks
bm_opf_high_vs_low
bm_write
bm_read
bm_fill
bm_mathfuns
bm_gain
bm_looping
bm_saturating
bm_ramp
bm_ADSR
bm_add
)

View file

@ -1,3 +1,3 @@
#!/bin/sh
script_dir="$(dirname "$0")"
cmake -D CMAKE_C_COMPILER=clang-9 -D CMAKE_CXX_COMPILER=clang++-9 -D CMAKE_CXX_FLAGS="-fsanitize=address" -D CMAKE_BUILD_TYPE=Release -S "$script_dir/.." -B .
cmake -D CMAKE_C_COMPILER=clang-9 -D CMAKE_CXX_COMPILER=clang++-9 -D CMAKE_CXX_FLAGS="-fsanitize=address" -D CMAKE_BUILD_TYPE=Release -D SFIZZ_TESTS=ON -D SFIZZ_BENCHMARKS=ON -S "$script_dir/.." -B .

View file

@ -1,3 +1,3 @@
#!/bin/sh
script_dir="$(dirname "$0")"
cmake -D CMAKE_C_COMPILER=clang-9 -D CMAKE_CXX_COMPILER=clang++-9 -D CMAKE_BUILD_TYPE=Debug -S "$script_dir/.." -B .
cmake -D CMAKE_C_COMPILER=clang-9 -D CMAKE_CXX_COMPILER=clang++-9 -D CMAKE_BUILD_TYPE=Debug -D SFIZZ_TESTS=ON -D SFIZZ_BENCHMARKS=ON -S "$script_dir/.." -B .

View file

@ -1,3 +1,3 @@
#!/bin/sh
script_dir="$(dirname "$0")"
cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -S "$script_dir/.." -B .
cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Debug -D SFIZZ_TESTS=ON -D SFIZZ_BENCHMARKS=ON -S "$script_dir/.." -B .

View file

@ -1,3 +1,3 @@
#!/bin/sh
script_dir="$(dirname "$0")"
cmake -D CMAKE_C_COMPILER=clang-9 -D CMAKE_CXX_COMPILER=clang++-9 -D CMAKE_BUILD_TYPE=Release -S "$script_dir/.." -B .
cmake -D CMAKE_C_COMPILER=clang-9 -D CMAKE_CXX_COMPILER=clang++-9 -D CMAKE_BUILD_TYPE=Release -D SFIZZ_TESTS=ON -D SFIZZ_BENCHMARKS=ON -S "$script_dir/.." -B .

View file

@ -1,3 +1,3 @@
#!/bin/sh
script_dir="$(dirname "$0")"
cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -S "$script_dir/.." -B .
cmake -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ -D CMAKE_BUILD_TYPE=Release -D SFIZZ_TESTS=ON -D SFIZZ_BENCHMARKS=ON -S "$script_dir/.." -B .

View file

@ -33,6 +33,7 @@ elseif (HAVE_ARM_NEON_H AND UNIX)
else()
set(SFIZZ_SIMD_SOURCES SIMDDummy.cpp)
endif()
set(SFIZZ_SOURCES ${SFIZZ_SOURCES} ${SFIZZ_SIMD_SOURCES})
add_library(sfizz_parser STATIC)