Vuo
1.2.5
|
A linear sequence of nodes along which an event may be transmitted.
Public Member Functions | |
VuoCompilerChain (vector< VuoCompilerNode * > nodes, bool lastNodeInLoop) | |
Creates a chain consisting of the given list of nodes. | |
Function * | generateScheduleWorker (Module *module, BasicBlock *block, Value *compositionStateValue, Value *contextValue, string triggerIdentifier, int minThreadsNeeded, int maxThreadsNeeded, size_t chainIndex, vector< size_t > upstreamChainIndices) |
Generates code that schedules the worker function for this chain to execute on the global dispatch queue. | |
void | generateWaitForUpstreamChains (Module *module, BasicBlock *block, Value *contextValue, const vector< size_t > &chainIndices) |
Generates code that waits on the dispatch groups for all chains immediately upstream of this chain. | |
void | generateCleanupForWorkerFunction (Module *module, BasicBlock *block, Value *contextValue, size_t chainIndex, bool hasDownstreamChains) |
Generates code that decrements the block count of the chain's dispatch group (indicating that other chains no longer need to wait on it) and releases memory. | |
vector< VuoCompilerNode * > | getNodes (void) |
Returns the sequence of nodes in this chain. | |
bool | isLastNodeInLoop (void) |
Returns true if this chain represents a single node that is the last (and only repeated) node in a feedback loop. | |
Static Public Member Functions | |
static Value * | generateMakeContext (Module *module, BasicBlock *block, Value *compositionStateValue, Value *eventIdValue, const vector< VuoCompilerChain * > &chains, const map< VuoCompilerChain *, vector< VuoCompilerChain * > > &chainsImmediatelyDownstream) |
Generates code to create a context that can be passed to chain worker functions. | |
static Value * | generateCompositionStateValue (Module *module, BasicBlock *block, Value *contextValue) |
Generates code that retrieves the composition identifier from the context argument of a chain worker function. | |
static Value * | generateEventIdValue (Module *module, BasicBlock *block, Value *contextValue) |
Generates code that retrieves the event ID from the context argument of a chain worker function. | |
static Function * | getFreeContextFunction (Module *module) |
Generates code that deallocates the context argument of a chain worker function. | |
VuoCompilerChain::VuoCompilerChain | ( | vector< VuoCompilerNode * > | nodes, |
bool | lastNodeInLoop | ||
) |
Creates a chain consisting of the given list of nodes.
nodes | A linear sequence of nodes. |
lastNodeInLoop | True if this chain represents a single node that is the last (and only repeated) node in a feedback loop. |
void VuoCompilerChain::generateCleanupForWorkerFunction | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | contextValue, | ||
size_t | chainIndex, | ||
bool | hasDownstreamChains | ||
) |
Generates code that decrements the block count of the chain's dispatch group (indicating that other chains no longer need to wait on it) and releases memory.
|
static |
Generates code that retrieves the composition identifier from the context argument of a chain worker function.
|
static |
Generates code that retrieves the event ID from the context argument of a chain worker function.
|
static |
Generates code to create a context that can be passed to chain worker functions.
The context contains an event ID and an array of dispatch groups. Each dispatch group has a block count of 1.
Function * VuoCompilerChain::generateScheduleWorker | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | compositionStateValue, | ||
Value * | contextValue, | ||
string | triggerIdentifier, | ||
int | minThreadsNeeded, | ||
int | maxThreadsNeeded, | ||
size_t | chainIndex, | ||
vector< size_t > | upstreamChainIndices | ||
) |
Generates code that schedules the worker function for this chain to execute on the global dispatch queue.
void VuoCompilerChain::generateWaitForUpstreamChains | ( | Module * | module, |
BasicBlock * | block, | ||
Value * | contextValue, | ||
const vector< size_t > & | chainIndices | ||
) |
Generates code that waits on the dispatch groups for all chains immediately upstream of this chain.
|
static |
Generates code that deallocates the context argument of a chain worker function.
vector< VuoCompilerNode * > VuoCompilerChain::getNodes | ( | void | ) |
Returns the sequence of nodes in this chain.
bool VuoCompilerChain::isLastNodeInLoop | ( | void | ) |
Returns true if this chain represents a single node that is the last (and only repeated) node in a feedback loop.