Public Documentation
Documentation for ComputableDAGs.jl's public interface.
See the Internals section of the manual for documentation of everything else.
Contents
Index
ComputableDAGs.ComputableDAGsComputableDAGs.initComputableDAGs.init_kernelComputableDAGs.@add_callComputableDAGs.@add_entryComputableDAGs.@assemble_dagComputableDAGs.@compute_task
Module
ComputableDAGs.ComputableDAGs — Module
ComputableDAGs.init — Method
init(mod::Module)Call this function once after using ComputableDAGs at the top level of your project. This is necessary to make RuntimeGeneratedFunctions work.
Usually, it is used like this:
using ComputableDAGs
ComputableDAGs.init(@__MODULE__)
# your projectThis can be skipped when there is a world age increase between the compute_function call and the call to the generated function. Generally, this is often the case in the REPL or in scripts, but not in a module.
ComputableDAGs.init_kernel — Function
Macros
ComputableDAGs.@add_call — Macro
@add_call task data varargsOnly valid within a @assemble_dag block.
Takes an AbstractComputeTask and arguments in the form of ComputeTaskNodes, creating a node in the dag currently being assembled (see @assemble_dag). The resulting node is returned to be used in subsequent @add_calls.
Arguments
task: The actual ComputeTask object to use.data: The data size of the result.varargs...: Any number of data nodes to use as input. They will be given to the task's function in the same order. Each argument can also be an iterable (vector, tuple, etc.) of nodes, which are automatically unpacked and added individually.
ComputableDAGs.@add_entry — Macro
@add_entry name dataOnly valid within a @assemble_dag block.
Add an entry node to the DAG currently being assembled, with the given name and expected resulting data size. An input_expr must be defined for the given name.
ComputableDAGs.@assemble_dag — Macro
@assemble_dag begin ... endTakes a code block within which the @add_call and @add_entry macros can be used. It returns the fully assembled DAG.
This macro can not be used recursively.
Example:
dag = @assemble_dag begin
entry_node = @add_entry "input" 64 # name and data size
compute1 = @add_call Compute1() 32 entry_node # task, output data size, and inputs
compute2 = @add_call Compute2() 16 compute1 entry_node # task, output data size, and inputs of the second compute node
# since no more nodes are added, compute2 is automatically the final result of the dag
endsourceComputableDAGs.@compute_task — Macro
@compute_task task effort [function]Defines a compute task to be later added in compute nodes to a DAG, for example using @add_call. Necessary arguments are the task name and its expected compute effort. Optionally, a function can be provided, making up the task's compute function. For example, to add a task type that simply adds two child nodes together:
@compute_task Add 1 (+)In some cases, the function to call might be more complex or need more specific information about the task type, like its type parametrization. For this reason, it is also possible to define the compute function for a compute task manually instead:
@compute_task ComplexTask{T1, T2} 50
ComputableDAGs.compute(::ComplexTask{Int, Float32}, v1, v2) = ...
ComputableDAGs.compute(::ComplexTask{String, Float32}, v1, v2) = ...source