Public Documentation

Documentation for ComputableDAGs.jl's public interface.

See the Internals section of the manual for documentation of everything else.

Contents

Index

Module

Macros

ComputableDAGs.@add_callMacro
@add_call task data varargs
Note

Only 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.
source
ComputableDAGs.@assemble_dagMacro
@assemble_dag begin ... end

Takes 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
end
source
ComputableDAGs.@compute_taskMacro
@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