mirror of
https://github.com/mikeoliphant/neural-amp-modeler-lv2.git
synced 2026-05-06 19:50:11 +02:00
CMake options for forcing use of NAM Core for LSTM or WaveNet
This commit is contained in:
@@ -23,6 +23,19 @@ if (DISABLE_DENORMALS)
|
||||
add_definitions(-DDISABLE_DENORMALS)
|
||||
endif (DISABLE_DENORMALS)
|
||||
|
||||
option(LSTM_PREFER_NAM "Always use NAM Core for NAM LSTM models" OFF)
|
||||
|
||||
if (LSTM_PREFER_NAM)
|
||||
add_definitions(-DLSTM_PREFER_NAM)
|
||||
endif (LSTM_PREFER_NAM)
|
||||
|
||||
option(WAVENET_PREFER_NAM "Always use NAM Core for NAM WaveNet models" OFF)
|
||||
|
||||
if (WAVENET_PREFER_NAM)
|
||||
add_definitions(-DWAVENET_PREFER_NAM)
|
||||
endif (WAVENET_PREFER_NAM)
|
||||
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(amd64)|(AMD64)|(x86_64)")
|
||||
option(USE_NATIVE_ARCH "Enable architecture-specific optimizations" OFF)
|
||||
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
#include "nam_plugin.h"
|
||||
|
||||
// LV2 Functions
|
||||
static LV2_Handle instantiate(const LV2_Descriptor*, double rate, const char*, const LV2_Feature* const* features
|
||||
) {
|
||||
static LV2_Handle instantiate(const LV2_Descriptor*, double rate, const char*, const LV2_Feature* const* features)
|
||||
{
|
||||
try
|
||||
{
|
||||
auto nam = std::make_unique<NAM::Plugin>();
|
||||
|
||||
@@ -12,6 +12,14 @@ namespace NAM {
|
||||
{
|
||||
// prevent allocations on the audio thread
|
||||
currentModelPath.reserve(MAX_FILE_NAME+1);
|
||||
|
||||
#ifdef LSTM_PREFER_NAM // Use NAM Core for NAM LSTM models
|
||||
NeuralAudio::NeuralModel::SetLSTMLoadMode(NeuralAudio::PreferNAMCore);
|
||||
#endif
|
||||
|
||||
#ifdef WAVENET_PREFER_NAM // Use NAM Core for NAM WaveNet models
|
||||
NeuralAudio::NeuralModel::SetWaveNetLoadMode(NeuralAudio::PreferNAMCore);
|
||||
#endif
|
||||
}
|
||||
|
||||
Plugin::~Plugin()
|
||||
|
||||
Reference in New Issue
Block a user