-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
307 additions
and
659 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
|
||
#include "Runtime.h" | ||
|
||
/* | ||
* Your main can call this function to run a complete benchmark test for either | ||
* float or double processing. Before the benchmark starts, your initCallback | ||
* will be called with a reference to the runtime for additional initialization, | ||
* like adding a custom node type or filling the shared resource map. | ||
*/ | ||
template <typename FloatType> | ||
void runBenchmark(std::string const& name, std::string const& inputFileName, std::function<void(elem::Runtime<FloatType>&)>&& initCallback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <iostream> | ||
#include <string> | ||
|
||
#include "Benchmark.h" | ||
|
||
|
||
int main(int argc, char **argv) | ||
{ | ||
// Read the input file from disk | ||
if (argc < 2) { | ||
std::cout << "Missing argument: what file do you want to run?" << std::endl; | ||
return 1; | ||
} | ||
|
||
auto inputFileName = std::string(argv[1]); | ||
|
||
runBenchmark<float>("Float", inputFileName, [](auto&) {}); | ||
runBenchmark<double>("Double", inputFileName, [](auto&) {}); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(cli VERSION 0.11.0) | ||
|
||
add_executable(elemcli Realtime.cpp) | ||
add_executable(elembench Benchmark.cpp) | ||
|
||
foreach(TARGET_NAME elemcli elembench) | ||
target_include_directories(${TARGET_NAME} PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/choc/javascript | ||
${CMAKE_CURRENT_SOURCE_DIR}/choc/text) | ||
|
||
target_compile_features(${TARGET_NAME} PRIVATE | ||
cxx_std_17) | ||
|
||
target_link_libraries(${TARGET_NAME} PRIVATE | ||
runtime) | ||
|
||
if(MSVC) | ||
target_compile_options(${TARGET_NAME} PRIVATE /W4) | ||
else() | ||
target_compile_options(${TARGET_NAME} PRIVATE -Wall -Wextra) | ||
endif() | ||
endforeach() | ||
add_library(elemcli_core STATIC Realtime.cpp Benchmark.cpp) | ||
|
||
target_include_directories(elemcli_core PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/choc/javascript | ||
${CMAKE_CURRENT_SOURCE_DIR}/choc/text) | ||
|
||
target_compile_features(elemcli_core PUBLIC | ||
cxx_std_17) | ||
|
||
target_link_libraries(elemcli_core PUBLIC | ||
runtime) | ||
|
||
if(MSVC) | ||
target_compile_options(elemcli_core PRIVATE /W4) | ||
else() | ||
target_compile_options(elemcli_core PRIVATE -Wall -Wextra) | ||
endif() | ||
|
||
add_executable(elemcli RealtimeMain.cpp) | ||
add_executable(elembench BenchmarkMain.cpp) | ||
|
||
target_link_libraries(elemcli PRIVATE elemcli_core) | ||
target_link_libraries(elembench PRIVATE elemcli_core) | ||
|
||
if(UNIX AND NOT APPLE) | ||
find_package(Threads REQUIRED) | ||
target_link_libraries(elemcli PRIVATE | ||
Threads::Threads | ||
${CMAKE_DL_LIBS}) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
|
||
#include "Runtime.h" | ||
|
||
/* | ||
* Your main can call this function to execute the realtime command line loop. Before audio playback | ||
* starts, your initCallback will be called with a reference to the elem::Runtime<float> instance | ||
* for your own initialization needs (i.e. registering new node types or adding shared resources). | ||
* | ||
* The Realtime loop runs only on float runtimes for now, so to avoid a template explosion | ||
* use a specialized runtime float in this callback. | ||
*/ | ||
extern int RealtimeMain(int argc, char **argv, std::function<void(elem::Runtime<float> &)> initCallback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "Realtime.h" | ||
|
||
|
||
int main(int argc, char **argv) | ||
{ | ||
return RealtimeMain(argc, argv, [](auto&) {}); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.