Toolchain cleanups
This commit is contained in:
parent
1df16518c1
commit
0a6171da2e
18 changed files with 66 additions and 22 deletions
|
|
@ -71,13 +71,17 @@ target_include_directories(readerwriterqueue INTERFACE "external/readerwriterque
|
||||||
add_subdirectory(sfizz)
|
add_subdirectory(sfizz)
|
||||||
add_subdirectory(clients)
|
add_subdirectory(clients)
|
||||||
|
|
||||||
|
if (SFIZZ_TESTS)
|
||||||
# Tests
|
# Tests
|
||||||
add_subdirectory(external/Catch2 EXCLUDE_FROM_ALL)
|
add_subdirectory(external/Catch2 EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(external/cnpy EXCLUDE_FROM_ALL)
|
add_subdirectory(external/cnpy EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (SFIZZ_BENCHMARKS)
|
||||||
# Benchmarks
|
# Benchmarks
|
||||||
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable Google Benchmark tests")
|
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable Google Benchmark tests")
|
||||||
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable Google Benchmark install")
|
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Disable Google Benchmark install")
|
||||||
add_subdirectory(external/benchmark EXCLUDE_FROM_ALL)
|
add_subdirectory(external/benchmark EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(benchmarks)
|
add_subdirectory(benchmarks)
|
||||||
|
endif()
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <benchmark/benchmark.h>
|
#include <benchmark/benchmark.h>
|
||||||
#include "../sources/ADSREnvelope.h"
|
#include "../sfizz/ADSREnvelope.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
@ -35,7 +35,7 @@ constexpr int release = attack;
|
||||||
constexpr int releaseTime = envelopeSize - static_cast<int>(envelopeSize / 4);
|
constexpr int releaseTime = envelopeSize - static_cast<int>(envelopeSize / 4);
|
||||||
|
|
||||||
// Explicitely instantiate class
|
// Explicitely instantiate class
|
||||||
#include "../sources/ADSREnvelope.cpp"
|
#include "../sfizz/ADSREnvelope.cpp"
|
||||||
template class sfz::ADSREnvelope<float>;
|
template class sfz::ADSREnvelope<float>;
|
||||||
|
|
||||||
static void Point(benchmark::State& state) {
|
static void Point(benchmark::State& state) {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
|
|
||||||
class AddArray : public benchmark::Fixture {
|
class AddArray : public benchmark::Fixture {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <benchmark/benchmark.h>
|
#include <benchmark/benchmark.h>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
#include "../sources/Buffer.h"
|
#include "../sfizz/Buffer.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
|
|
||||||
class GainSingle : public benchmark::Fixture {
|
class GainSingle : public benchmark::Fixture {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <absl/algorithm/container.h>
|
#include <absl/algorithm/container.h>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
|
|
||||||
// In this one we have an array of indices
|
// In this one we have an array of indices
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
#include "absl/types/span.h"
|
#include "absl/types/span.h"
|
||||||
#include <benchmark/benchmark.h>
|
#include <benchmark/benchmark.h>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#include <benchmark/benchmark.h>
|
#include <benchmark/benchmark.h>
|
||||||
#include <random>
|
#include <random>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
#include "../sources/Buffer.h"
|
#include "../sfizz/Buffer.h"
|
||||||
|
|
||||||
|
|
||||||
static void Dummy(benchmark::State& state) {
|
static void Dummy(benchmark::State& state) {
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <benchmark/benchmark.h>
|
#include <benchmark/benchmark.h>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
#include "../sources/Buffer.h"
|
#include "../sfizz/Buffer.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <absl/types/span.h>
|
#include <absl/types/span.h>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <absl/algorithm/container.h>
|
#include <absl/algorithm/container.h>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
|
|
||||||
// In this one we have an array of indices
|
// In this one we have an array of indices
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <benchmark/benchmark.h>
|
#include <benchmark/benchmark.h>
|
||||||
#include "../sources/SIMDHelpers.h"
|
#include "../sfizz/SIMDHelpers.h"
|
||||||
#include "../sources/Buffer.h"
|
#include "../sfizz/Buffer.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <absl/types/span.h>
|
#include <absl/types/span.h>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,29 @@
|
||||||
project(sfizz)
|
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)
|
add_executable(bm_opf_high_vs_low BM_OPF_high_vs_low.cpp)
|
||||||
target_link_libraries(bm_opf_high_vs_low benchmark absl::span)
|
target_link_libraries(bm_opf_high_vs_low benchmark absl::span)
|
||||||
|
|
||||||
|
|
@ -32,3 +56,18 @@ target_link_libraries(bm_ADSR benchmark absl::span absl::algorithm)
|
||||||
|
|
||||||
add_executable(bm_add BM_add.cpp ${SFIZZ_SIMD_SOURCES})
|
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
|
||||||
|
)
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
script_dir="$(dirname "$0")"
|
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 .
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
script_dir="$(dirname "$0")"
|
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 .
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
script_dir="$(dirname "$0")"
|
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 .
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
script_dir="$(dirname "$0")"
|
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 .
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
script_dir="$(dirname "$0")"
|
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 .
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ elseif (HAVE_ARM_NEON_H AND UNIX)
|
||||||
else()
|
else()
|
||||||
set(SFIZZ_SIMD_SOURCES SIMDDummy.cpp)
|
set(SFIZZ_SIMD_SOURCES SIMDDummy.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SFIZZ_SOURCES ${SFIZZ_SOURCES} ${SFIZZ_SIMD_SOURCES})
|
set(SFIZZ_SOURCES ${SFIZZ_SOURCES} ${SFIZZ_SIMD_SOURCES})
|
||||||
|
|
||||||
add_library(sfizz_parser STATIC)
|
add_library(sfizz_parser STATIC)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue