All non realtime: Add clean up calls, in case of reallocation

nix
Owen Green 7 years ago
parent 004bd4f9fc
commit 541474bf69

@ -64,14 +64,24 @@ namespace fluid {
bool postProcess(World* world)
{
static_cast<SCBufferView*>
(parameter::lookupParam("harmbuf", processor.getParams()).getBuffer())->assignToRT(world);
static_cast<SCBufferView*>
(parameter::lookupParam("percbuf", processor.getParams()).getBuffer())->assignToRT(world);
static_cast<SCBufferView*>(mModel.harm)->assignToRT(world);
static_cast<SCBufferView*>(mModel.perc)->assignToRT(world);
if(mModel.res)
static_cast<SCBufferView*>(mModel.res)->assignToRT(world);
return true;
}
bool postComplete(World* w) { return true; }
bool postComplete(World*) {
static_cast<SCBufferView*>(mModel.harm)->cleanUp();
static_cast<SCBufferView*>(mModel.perc)->cleanUp();
if(mModel.res)
static_cast<SCBufferView*>(mModel.res)->cleanUp();
return true;
}
std::vector<parameter::Instance>& parameters()
{
return processor.getParams();

@ -103,7 +103,16 @@ namespace fluid {
return true;
}
bool postComplete(World* w) { return true; }
bool postComplete(World*) {
if(mModel.resynthesise)
resynth->cleanUp();
if(mModel.returnDictionaries)
dict->cleanUp();
if(mModel.returnActivations)
act->cleanUp();
return true;
}
std::vector<parameter::Instance>& parameters()
{
return nmf.getParams();

@ -47,11 +47,15 @@ namespace fluid {
bool postProcess(World* world)
{
static_cast<SCBufferView*>(mModel.indices)->assignToRT(world);
static_cast<SCBufferView*>(mModel.indices)->assignToRT(world);
return true;
}
bool postComplete(World*) {
static_cast<SCBufferView*>(mModel.indices)->cleanUp();
return true;
}
bool postComplete(World* w) { return true; }
std::vector<parameter::Instance>& parameters()
{
return trans.getParams();

@ -69,14 +69,17 @@ namespace fluid {
bool postProcess(World* world)
{
static_cast<SCBufferView*>
(parameter::lookupParam("sinebuf", processor.getParams()).getBuffer())->assignToRT(world);
static_cast<SCBufferView*>
(parameter::lookupParam("resbuf", processor.getParams()).getBuffer())->assignToRT(world);
static_cast<SCBufferView*>(mModel.sine)->assignToRT(world);
static_cast<SCBufferView*>(mModel.res)->assignToRT(world);
return true;
}
bool postComplete(World* w) {
static_cast<SCBufferView*>(mModel.sine)->cleanUp();
static_cast<SCBufferView*>(mModel.res)->cleanUp();
return true;
}
bool postComplete(World* w) { return true; }
std::vector<parameter::Instance>& parameters()
{
return processor.getParams();

@ -48,11 +48,16 @@ namespace fluid {
bool postProcess(World* world)
{
static_cast<SCBufferView*>(mModel.trans)->assignToRT(world);
static_cast<SCBufferView*>(mModel.trans)->assignToRT(world);
return true;
}
bool postComplete(World*)
{
static_cast<SCBufferView*>(mModel.trans)->cleanUp();
return true;
}
bool postComplete(World* w) { return true; }
std::vector<parameter::Instance>& parameters()
{
return trans.getParams();

@ -1,8 +1,6 @@
// FD_BufNMF, an NRT buffer NMF Processor
// A tool from the FluCoMa project, funded by the European Research Council (ERC) under the European Unions Horizon 2020 research and innovation programme (grant agreement No 725899)
#define EIGEN_USE_BLAS
#include "clients/nrt/TransientNRTClient.hpp"
#include "fdNRTBase.hpp"
#include "data/FluidTensor.hpp"
@ -55,7 +53,15 @@ namespace fluid {
return true;
}
bool postComplete(World* w) { return true; }
bool postComplete(World*)
{
if(mModel.returnTransients)
static_cast<SCBufferView*>(mModel.trans)->cleanUp();
if(mModel.returnResidual)
static_cast<SCBufferView*>(mModel.res)->cleanUp();
return true;
}
std::vector<parameter::Instance>& parameters()
{
return trans.getParams();

Loading…
Cancel
Save