Class/Object

cogx.runtime

ComputeGraph

Related Docs: object ComputeGraph | package runtime

Permalink

class ComputeGraph extends Saveable

A Cog computation graph.

Linear Supertypes
Saveable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ComputeGraph
  2. Saveable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ComputeGraph()

    Permalink

    Default constructor for users, forces optimization (though they can disable it to varying degrees using probes or probeAll.)

  2. new ComputeGraph(optimize: Boolean = true, device: Option[Int] = None, fftUse: platform.types.ConvolutionFFTUsePolicy = UseFFTWhenBest, convolveSmallTensorUse: platform.types.ConvolutionSmallTensorUsePolicy = UseSmallTensorWhenBest)

    Permalink

    optimize

    When false, turns off the optimizer, allowing the graph to be more easily debugged, since all fields declared by the user remain visible.

    fftUse

    policy for FFT use in fast convolution.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def Verbose: Boolean

    Permalink

    Debug flag

  5. def VerbosePrint: Boolean

    Permalink

    Turns on printing of the compiled circuit for debugging.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. lazy val codeGenerator: OpenCLCodeGenerator

    Permalink

    Translator from SyntaxTree to KernelCircuit

  9. var computeGraphName: String

    Permalink

    A user-friendly name for this computegraph.

    A user-friendly name for this computegraph. Used in logs and for debugging.

  10. def debugTouch: Unit

    Permalink
  11. def description: Option[String]

    Permalink

    The user's description of this computegraph.

  12. def description_=(desc: String): Unit

    Permalink

    Set a description for the computegraph.

    Set a description for the computegraph. Used in logs and for debugging.

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def getUnpipelinedActuator(sourceFieldName: String): compiler.parser.syntaxtree.UnpipelinedActuator

    Permalink

    Retrieve an Unpipelinedactuator from a restored compute graph using the name of the source field.

  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. val mode: AllocationMode

    Permalink

    The specific device(s) that will evaluate the ComputeGraph, now bound at ComputeGraph creation time.

  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. val optimize: Boolean

    Permalink

    When false, turns off the optimizer, allowing the graph to be more easily debugged, since all fields declared by the user remain visible.

  25. def print(): Unit

    Permalink

    Print out the ComputeGrap for debugging.

  26. def printEvaluator: Unit

    Permalink
  27. def probeAll: Unit

    Permalink

    Probe all fields; this effectively disables the optimizer.

  28. lazy val probedCircuit: ProbedCircuit

    Permalink

    Optimized circuit that exposes only probed fields (for debugger).

  29. def read(field: ProbedField, done: (ProbedField, platform.cpumemory.AbstractFieldMemory) ⇒ Unit): Unit

    Permalink

    Future interface for debugger.

    Future interface for debugger. Note that the AbstractFieldMemory referenced in done must be released before the field can be read again.

  30. def read(field: ProbedField, to: platform.cpumemory.AbstractFieldMemory, done: (ProbedField, platform.cpumemory.AbstractFieldMemory) ⇒ Unit): Unit

    Permalink

    Read a field, calling done when the field data is available (asynchronous call).

    Read a field, calling done when the field data is available (asynchronous call). This primarily used by the debugger, but may be used by arbitrary user code.

    field

    The field that is being read

    to

    Pre-allocated field memory, passed to the done function, that receives the read field data.

    done

    Callback which returns memory holding the field data; this memory must be released before this field can be read again.

  31. def read(field: compiler.parser.syntaxtree.Field): platform.cpumemory.readerwriter.FieldReader

    Permalink

    Read a field (user access to the field data).

  32. def readByName(fieldName: String): platform.cpumemory.readerwriter.FieldReader

    Permalink

    Read a field given the name.

    Read a field given the name. Used typically for restored compute graphs that no longer have fields.

  33. def release: Unit

    Permalink

    Release all resources for this (and ALL) compute graphs.

    Release all resources for this (and ALL) compute graphs.

    This attempts to minimize memory leaks due to the JVM garbage collector not being able to handle direct memory very well.

    After release of a ComputeGraph, we still have references to the Direct Buffers from singleton objects like HyperCircuit, which prevents the direct buffer freeing from being immediately successful. Making a new ComputeGraph should overwrite those references, thus freeing up the direct memory for the next ComputeGraph. Making a tiny ComputeGraph and releasing it between 'real' ComputeGraphs would be one hack at the user level to combat direct buffer freeing problems.

  34. def reset: Long

    Permalink

    Reset the computation to an initial state defined by the user (synchronous call).

    Reset the computation to an initial state defined by the user (synchronous call).

    If the computation is running, it is stopped before the initialization takes place.

    returns

    Zero (the simulation time after reset).

  35. def run: Unit

    Permalink

    Start the computation running until stop is called (asynchronous call)

  36. def save(saver: ObjectSaver): Unit

    Permalink

    Write this compute graph instance with the facilities offered by an ObjectSaver.

    Write this compute graph instance with the facilities offered by an ObjectSaver.

    Definition Classes
    ComputeGraphSaveable
  37. def step(count: Long): Long

    Permalink

    Step the computation count cycles, returning the resulting simulation time (synchronous call).

    Step the computation count cycles, returning the resulting simulation time (synchronous call).

    count

    Number of steps to take.

    returns

    the number of steps taken from the last reset

  38. def step: Long

    Permalink

    Step the computation one cycle, returning the resulting simulation time (synchronous call).

    Step the computation one cycle, returning the resulting simulation time (synchronous call).

    returns

    the number of steps taken from the last reset

  39. def stop: Long

    Permalink

    Stop the computation, returning the simulation time (synchronous call).

  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  41. def time(done: (Long) ⇒ Unit): Unit

    Permalink

    Get the current simulation time (asynchronous call).

    Get the current simulation time (asynchronous call).

    done

    Callback function with the simulation time

  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. def withRelease(operations: ⇒ Unit): Unit

    Permalink

    Make sure release is called, even if an exception is thrown.

  47. def write(filename: String, checkpointerType: platform.types.CheckpointerType = ...): Unit

    Permalink

    Write the compute graph to a file with the given checkpoint technology (e.g.

    Write the compute graph to a file with the given checkpoint technology (e.g. hdf5)

Inherited from Saveable

Inherited from AnyRef

Inherited from Any

Ungrouped