Trait

scalan.primitives

Thunks

Related Doc: package primitives

Permalink

trait Thunks extends Base with Functions with GraphVizExport

Slice in the Scalan cake with definitions of Thunk operations. See https://en.wikipedia.org/wiki/Thunk. Thunks are used to represent lazy operations in the graph IR.

Self Type
Scalan
See also

ApplyBinOpLazy, IfThenElseLazy

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Thunks
  2. GraphVizExport
  3. Functions
  4. ProgramGraphs
  5. AstGraphs
  6. Transforming
  7. Base
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class Apply[A, B](f: Scalan.Ref[(A) ⇒ B], arg: Scalan.Ref[A], mayInline: Boolean = true) extends Scalan.Node with Scalan.Def[B] with Product with Serializable

    Permalink
    Definition Classes
    Functions
  2. abstract class AstGraph extends Scalan.Node

    Permalink

    Base class for all compound nodes with schedule (e.g.

    Base class for all compound nodes with schedule (e.g. Lambda, ThunkDef). The graph is directed acyclic (i.e. DAG) in which edges go from boundVars down to roots.

    Definition Classes
    AstGraphs
  3. abstract class BaseDef[+T] extends Scalan.Node with Scalan.Def[T]

    Permalink

    Base class for most predefined operations.

    Base class for most predefined operations.

    Definition Classes
    Base
  4. abstract class CompanionDef[T] extends Scalan.Node with Scalan.Def[T]

    Permalink

    Base class for virtualized instances of type companions.

    Base class for virtualized instances of type companions. Each virtualized entity type (trait or class) may have virtualized companion class.

    Definition Classes
    Base
  5. case class Const[T](x: T)(implicit eT: Scalan.Elem[T]) extends Scalan.BaseDef[T] with Product with Serializable

    Permalink

    Default node type for embedding of literal values to graph IR.

    Default node type for embedding of literal values to graph IR. This can be used or those types T when Elem[T] is defined, but Liftable[_,T] is not, i.e. for non-liftable types.

    x

    literal value

    eT

    type descriptor of IR type T

    Definition Classes
    Base
  6. trait Def[+T] extends Scalan.Node

    Permalink

    Base type for all graph nodes (aka computable value definitions).

    Base type for all graph nodes (aka computable value definitions). Each graph node or definition represent one operation node of the data flow graph.

    Definition Classes
    Base
  7. class DefaultPass extends Scalan.Pass

    Permalink

    Default pass to be used when IR is used without special compiler configuration.

    Default pass to be used when IR is used without special compiler configuration.

    Definition Classes
    Transforming
  8. class EntityObject extends AnyRef

    Permalink

    Base class for all objects generated for virtualized types to support staged evaluation machinery.

    Base class for all objects generated for virtualized types to support staged evaluation machinery. Each object contains definitions which can be imported when necessary. All that objects are registered in entityObjects hash map, which is done while IR cake is constructed.

    Definition Classes
    Base
  9. case class EntityObjectOwner(obj: Scalan.EntityObject) extends Scalan.OwnerKind with Product with Serializable

    Permalink
    Definition Classes
    Base
  10. implicit class FuncExtensions[A, B] extends AnyRef

    Permalink
    Definition Classes
    Functions
  11. case class GraphFile(file: File, fileType: String) extends Product with Serializable

    Permalink
    Definition Classes
    GraphVizExport
  12. case class GraphNode(sym: Scalan.Sym, usages: Buffer[Int]) extends Product with Serializable

    Permalink

    GraphNode is created for each symbol of the AstGraph and represents graph linking structure

    GraphNode is created for each symbol of the AstGraph and represents graph linking structure

    Definition Classes
    AstGraphs
  13. class Lambda[A, B] extends Scalan.AstGraph with Scalan.Def[(A) ⇒ B]

    Permalink

    Represent lambda expression as IR node.

    Represent lambda expression as IR node.

    Definition Classes
    Functions
  14. type LambdaData[A, B] = (Scalan.Lambda[A, B], Nullable[(Scalan.Ref[A]) ⇒ Scalan.Ref[B]], Scalan.Ref[A], Scalan.Ref[B])

    Permalink
    Definition Classes
    Functions
  15. implicit class LambdaOps[A, B] extends AnyRef

    Permalink
    Definition Classes
    Functions
  16. class LambdaStack extends AnyRef

    Permalink
    Definition Classes
    Functions
  17. case class LiftableThunk[ST, T](lT: Base.Liftables.Liftable[ST, T]) extends Base.Liftables.Liftable[Scalan.SThunk[ST], Scalan.Thunk[T]] with Product with Serializable

    Permalink

    Implementation of Liftable type class for Thunk[T] given liftable for T.

  18. case class MapTransformer(subst: HashMap[Scalan.Sym, Scalan.Sym]) extends Scalan.Transformer with Product with Serializable

    Permalink

    Concrete and default implementation of Transformer using underlying HashMap.

    Concrete and default implementation of Transformer using underlying HashMap.

    Definition Classes
    Transforming
  19. abstract class Mirror extends AnyRef

    Permalink

    Base class for mirrors of graph nodes.

    Base class for mirrors of graph nodes. Provides default implementations which can be overriden if special logic is required.

    Definition Classes
    Transforming
  20. abstract class Node extends Product

    Permalink

    Base class for all IR nodes/operations/definitions.

    Base class for all IR nodes/operations/definitions.

    Definition Classes
    Base
  21. class NotImplementedStagingException extends Scalan.StagingException

    Permalink
    Definition Classes
    Base
  22. sealed abstract class OwnerKind extends AnyRef

    Permalink

    Variants of owner parameter of constructors of nested classes: 1) predefined node classes are owned by IR cake (ScalanOwner) 2) entity classes are owned by enclosing EntityObject

    Variants of owner parameter of constructors of nested classes: 1) predefined node classes are owned by IR cake (ScalanOwner) 2) entity classes are owned by enclosing EntityObject

    Definition Classes
    Base
  23. type PGraph = Scalan.ProgramGraph

    Permalink
    Definition Classes
    ProgramGraphs
  24. class PGraphUsages extends DFunc[Int, Buffer[Int]]

    Permalink

    Deboxed function to obtain usages of a given node.

    Deboxed function to obtain usages of a given node. Represents adjacency matrix of the reversed graph g.

    Definition Classes
    ProgramGraphs
  25. implicit class PartialRewriter extends Scalan.Rewriter

    Permalink

    Turns partial function into rewriter (i.e.

    Turns partial function into rewriter (i.e. set of rewriting rules)

    Definition Classes
    Transforming
  26. abstract class Pass extends AnyRef

    Permalink

    Descriptor of a current compiler pass.

    Descriptor of a current compiler pass. Compiler can be configured to perform one pass after another. Each pass has name, configuration parameters, finalizaton logic etc.

    Definition Classes
    Transforming
  27. case class PassConfig(shouldUnpackTuples: Boolean = false, shouldExtractFields: Boolean = true, constantPropagation: Boolean = true, shouldSlice: Boolean = false) extends Product with Serializable

    Permalink

    Configuration parameters of the Pass descriptor.

    Configuration parameters of the Pass descriptor.

    Definition Classes
    Transforming
  28. case class Placeholder[T](eT: Scalan.LElem[T]) extends Scalan.Node with Scalan.Def[T] with Product with Serializable

    Permalink

    Symbols may temporary refer to this node until their target node is updated.

    Symbols may temporary refer to this node until their target node is updated.

    Definition Classes
    Base
  29. case class ProgramGraph(roots: Seq[Scalan.Sym], mapping: Nullable[Scalan.Transformer], filterNode: Nullable[(Scalan.Sym) ⇒ Boolean]) extends Scalan.AstGraph with Product with Serializable

    Permalink

    Immutable graph collected from roots following Ref.node.deps links.

    Immutable graph collected from roots following Ref.node.deps links.

    Definition Classes
    ProgramGraphs
  30. type RFunc[-A, +B] = Scalan.Ref[(A) ⇒ B]

    Permalink
    Definition Classes
    Base
  31. type RPair[+A, +B] = Scalan.Ref[(A, B)]

    Permalink
    Definition Classes
    Base
  32. abstract class Ref[+T] extends AnyRef

    Permalink

    Abstract representation of a computable value.

    Abstract representation of a computable value. Default implementation is a simple lightweight reference to the corresponding definition. Every Ref have direct access to its Def via node property. Every Ref is typed, and the type is avaliable via elem property.

    Definition Classes
    Base
    See also

    SingleRep

  33. implicit class RepThunkOps[T] extends AnyRef

    Permalink

    Extension methods on Ref[Thunk[T]] values.

  34. abstract class Rewriter extends AnyRef

    Permalink
    Definition Classes
    Transforming
  35. type SThunk[T] = () ⇒ T

    Permalink

    Runtime representation of lazy values.

    Runtime representation of lazy values. Each Thunk typed graph node evaluates to a value of this type.

  36. type Schedule = Seq[Scalan.Sym]

    Permalink

    Type synonim for graph schedules.

    Type synonim for graph schedules.

    Definition Classes
    AstGraphs
  37. type ScheduleIds = Buffer[Int]

    Permalink

    Alternative representation of schedules using node ids.

    Alternative representation of schedules using node ids.

    Definition Classes
    AstGraphs
  38. implicit class SeqExpExtensionsForEmitGraph extends AnyRef

    Permalink
    Definition Classes
    GraphVizExport
  39. final class SingleRef[+T] extends Scalan.Ref[T]

    Permalink

    A Ref is a symbolic reference used internally to refer to graph nodes.

    A Ref is a symbolic reference used internally to refer to graph nodes. Light weight stateless immutable reference to a graph node (Def[T]). Two symbols are equal if they refer to the nodes with the same id, which is due to Def unification means equal symbols refer to the same instance of Def.

    Definition Classes
    Base
  40. class StagingException extends RuntimeException

    Permalink
    Definition Classes
    Base
  41. type Subst = HashMap[Scalan.Sym, Scalan.Sym]

    Permalink
    Definition Classes
    Functions
  42. type Sym = Scalan.Ref[_]

    Permalink

    Untyped shortcut sinonim of Ref, which is used as untyped reference to graph nodes (definitions).

    Untyped shortcut sinonim of Ref, which is used as untyped reference to graph nodes (definitions). Following a tradition in compiler engineering we call references to definitions as symbols.

    Definition Classes
    Base
  43. type Th[+T] = Scalan.Ref[Scalan.Thunk[T]]

    Permalink
  44. trait Thunk[+A] extends AnyRef

    Permalink

    Phantom type to define thunk-typed graph nodes and thunk based lazy operations.

    Phantom type to define thunk-typed graph nodes and thunk based lazy operations. Usually used inside Ref, see for example Th. See also for details http://gigiigig.github.io/tlp-step-by-step/phantom-types.html

  45. class ThunkCompanion extends AnyRef

    Permalink

    A class of factory to create new Thunks by use Thunk { ... } expressions.

  46. case class ThunkConst[ST, T](constValue: Scalan.SThunk[ST], lT: Base.Liftables.Liftable[ST, T]) extends Scalan.BaseDef[Scalan.Thunk[T]] with LiftedConst[Scalan.SThunk[ST], Scalan.Thunk[T]] with Product with Serializable

    Permalink

    Graph node to represent constants of type Thunk.

    Graph node to represent constants of type Thunk.

    See also

    scalan.Base.Liftables.Liftable

  47. class ThunkDef[A] extends Scalan.AstGraph with Scalan.Def[Scalan.Thunk[A]]

    Permalink

    Graph node representing thunk with reified body.

    Graph node representing thunk with reified body. Each thunk node is a specialized implementation of AstGraph abstract class.

  48. case class ThunkElem[A](eItem: Scalan.Elem[A]) extends Scalan.EntityElem1[A, Scalan.Thunk[A], Scalan.Thunk] with Product with Serializable

    Permalink

    Implements a type descriptor of Thunk[A] type given the instance of A.

  49. case class ThunkForce[A](thunk: Scalan.Ref[Scalan.Thunk[A]]) extends Scalan.Node with Scalan.Def[A] with Product with Serializable

    Permalink

    Graph node to represent thunk forcing operation.

  50. class ThunkScope extends AnyRef

    Permalink

    Helper object to handle construction of nested thunks.

    Helper object to handle construction of nested thunks. One instance is created for each ThunkDef under construction. This corresponds to syntactic nesting of thunks.

  51. class ThunkStack extends AnyRef

    Permalink

    The stack of nested thunks during graph construction.

  52. abstract class Transformer extends AnyRef

    Permalink

    Base class for Ref to Ref transformations.

    Base class for Ref to Ref transformations. Each transformer keeps a mapping data between references to original nodes and references to the corresponding transformed nodes.

    Definition Classes
    Base
  53. case class Variable[T](varId: Int)(implicit eT: Scalan.LElem[T]) extends Scalan.Node with Scalan.Def[T] with Product with Serializable

    Permalink

    Node class for typed variables.

    Node class for typed variables. In particular for lambda-bound variables.

    varId

    is independent from nodeId, shouldn't be used as node id.

    eT

    type descriptor of the variable type

    Definition Classes
    Base
  54. type |[+A, +B] = Either[A, B]

    Permalink
    Definition Classes
    Base

Value Members

  1. def !!!(msg: String, e: Throwable, syms: Scalan.Ref[_]*): Nothing

    Permalink
    Definition Classes
    Base
  2. def !!!(msg: String, syms: Scalan.Ref[_]*): Nothing

    Permalink
    Definition Classes
    Base
  3. def !!!: Nothing

    Permalink

    Helper methods to throw errors

    Helper methods to throw errors

    Definition Classes
    Base
  4. final def !=(arg0: Any): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  6. object &&

    Permalink

    Logical AND between two pattern matches of the save value x.

    Logical AND between two pattern matches of the save value x. Can be used to construct patterns like case P1 && P2 => ...

    Definition Classes
    Base
  7. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def ???(value: Any, syms: Scalan.Ref[_]*): Nothing

    Permalink
    Definition Classes
    Base
  9. def ???: Nothing

    Permalink
    Definition Classes
    Base
  10. object ConstantLambda

    Permalink

    Matcher for lambdas which don't depend on their arguments (but can close over other expressions, unlike VeryConstantLambda).

    Matcher for lambdas which don't depend on their arguments (but can close over other expressions, unlike VeryConstantLambda).

    Definition Classes
    Functions
  11. object ConstantThunk

    Permalink
  12. object Def

    Permalink
    Definition Classes
    Base
  13. val DefaultMirror: Scalan.Mirror

    Permalink

    Default Mirror instance which is used in core IR methods.

    Default Mirror instance which is used in core IR methods.

    Definition Classes
    Transforming
  14. val EmptyArrayOfSym: Array[Scalan.Sym]

    Permalink

    Immutable empty array of symbols, can be used to avoid unnecessary allocations.

    Immutable empty array of symbols, can be used to avoid unnecessary allocations.

    Definition Classes
    Base
  15. val EmptyDSetOfInt: Set[Int]

    Permalink

    Used internally in IR and should be used with care since it is mutable.

    Used internally in IR and should be used with care since it is mutable. At the same time, it is used in the hotspot and allows to avoid roughly tens of thousands of allocations per second. WARNING: Mutations of this instance can lead to undefined behavior.

    Attributes
    protected
    Definition Classes
    Base
  16. val EmptySeqOfSym: Seq[Scalan.Sym]

    Permalink

    Immutable empty Seq, can be used to avoid unnecessary allocations.

    Immutable empty Seq, can be used to avoid unnecessary allocations.

    Definition Classes
    Base
  17. object ExpWithElem

    Permalink
    Definition Classes
    Base
  18. object IdentityLambda

    Permalink
    Definition Classes
    Functions
  19. final def IntZero: Scalan.Ref[Int]

    Permalink

    Zero literal node, which is lazily created and can be efficiently reused.

    Zero literal node, which is lazily created and can be efficiently reused. Much faster alternative to (0: Rep[Int]) or toRep(0).

    Definition Classes
    Base
    Annotations
    @inline()
  20. object Lambda

    Permalink
    Definition Classes
    Functions
  21. object Liftables

    Permalink

    Data type ST is liftable is there is Liftable[ST, T] instance for some type T.

    Data type ST is liftable is there is Liftable[ST, T] instance for some type T. Liftable typeclass allows to define which types can have values embedded as literals into graph IR.

    Definition Classes
    Base
  22. object MapTransformer extends Serializable

    Permalink
    Definition Classes
    Transforming
  23. object NoOwner extends Scalan.OwnerKind with Product with Serializable

    Permalink
    Definition Classes
    Base
  24. val NoRewriting: Scalan.Rewriter

    Permalink

    Identity rewriter, i.e.

    Identity rewriter, i.e. doesn't change the graph when applied.

    Definition Classes
    Transforming
  25. object Pass

    Permalink
    Definition Classes
    Transforming
  26. object ProgramGraph extends Serializable

    Permalink
    Definition Classes
    ProgramGraphs
  27. object ScalanOwner extends Scalan.OwnerKind with Product with Serializable

    Permalink
    Definition Classes
    Base
  28. val Thunk: Scalan.ThunkCompanion

    Permalink

    Allow expressions like Thunk { ... } to create new Thunks.

  29. object ThunkDef

    Permalink
  30. object VeryConstantLambda

    Permalink

    Matcher for lambdas which return staging-time constants.

    Matcher for lambdas which return staging-time constants. VeryConstantLambda(x) should be equivalent to ConstantLambda(Def(Const(x)))

    Definition Classes
    Functions
  31. var _currentPass: Scalan.Pass

    Permalink
    Definition Classes
    Transforming
  32. def alphaEqual(s1: Scalan.Sym, s2: Scalan.Sym): Boolean

    Permalink
    Definition Classes
    Functions
  33. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  34. final def asRep[T](x: Scalan.Ref[_]): Scalan.Ref[T]

    Permalink

    Helper to type cast node references.

    Helper to type cast node references.

    Definition Classes
    Base
    Annotations
    @inline()
  35. def beginPass(pass: Scalan.Pass): Unit

    Permalink

    Called to setup IR before the new pass is executed.

    Called to setup IR before the new pass is executed.

    Definition Classes
    Transforming
  36. val cacheElems: Boolean

    Permalink

    Whether IR type descriptors should be cached.

    Whether IR type descriptors should be cached.

    Definition Classes
    Base
  37. val cachePairs: Boolean

    Permalink

    Whether Tup instances should be cached.

    Whether Tup instances should be cached.

    Definition Classes
    Base
  38. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def clusterColor(g: Scalan.AstGraph): Option[String]

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  40. def clusterSchedule(g: Scalan.AstGraph): Seq[Scalan.Sym]

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  41. def compose[A, B, C](f: Scalan.Ref[(B) ⇒ C], g: Scalan.Ref[(A) ⇒ B]): Scalan.Ref[(A) ⇒ C]

    Permalink

    Composition of two functions (in mathematical notation), where first g is applied and them f.

    Composition of two functions (in mathematical notation), where first g is applied and them f.

    Definition Classes
    Functions
  42. def constFun[A, B](x: Scalan.Ref[B])(implicit e: Scalan.Elem[A]): Scalan.Ref[(A) ⇒ B]

    Permalink
    Definition Classes
    Functions
  43. def createDefinition[T](optScope: Nullable[Scalan.ThunkScope], s: Scalan.Ref[T], d: Scalan.Def[T]): Scalan.Ref[T]

    Permalink

    Create new definition entry in either given Thunk or in the global hash table.

    Create new definition entry in either given Thunk or in the global hash table.

    optScope

    optional thunk scope to put given definition

    s

    symbol refering to d

    d

    definition node to add to the scope of globally

    returns

    reference to d (which is s)

    Attributes
    protected
    Definition Classes
    Base
  44. def currentPass: Scalan.Pass

    Permalink

    IR global current Pass, changes when the compier switches from one pass to the next one.

    IR global current Pass, changes when the compier switches from one pass to the next one. Should remain constant during the whole pass execution.

    Definition Classes
    Transforming
  45. val debugModeSanityChecks: Boolean

    Permalink

    Whether to perform extended checks of correctness, expected invariants and data consistency.

    Whether to perform extended checks of correctness, expected invariants and data consistency. NOTE: Since it may add substantial overhead, set it to false before using in production.

    Definition Classes
    Base
  46. def defCount: Int

    Permalink

    Returns a number of definitions added to this IR context.

    Returns a number of definitions added to this IR context.

    Definition Classes
    Base
  47. def def_unapply[T](e: Scalan.Ref[T]): Nullable[Scalan.Def[T]]

    Permalink
    Definition Classes
    Base
  48. def defaultGraphVizConfig: GraphVizConfig

    Permalink
    Definition Classes
    GraphVizExport
  49. def emitDepGraph(exceptionOrGraph: Either[Throwable, Scalan.AstGraph], directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  50. def emitDepGraph(graph: Scalan.AstGraph, directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  51. def emitDepGraph(ss: Seq[Scalan.Sym], directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  52. def emitDepGraph(start: Scalan.Sym, directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  53. def emitDepGraph(d: Scalan.Def[_], directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  54. def emitDot(dotText: String, directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  55. def emitExceptionGraph(e: Throwable, directory: File, fileName: String)(implicit config: GraphVizConfig): Option[Scalan.GraphFile]

    Permalink
    Definition Classes
    GraphVizExport
  56. final def emptyDBufferOfSym: Buffer[Scalan.Sym]

    Permalink

    Create a new empty buffer around pre-allocated empty array.

    Create a new empty buffer around pre-allocated empty array. This method is preferred, rather that creating empty debox.Buffer directly because it allows to avoid allocation of the empty array.

    Definition Classes
    Base
    Annotations
    @inline()
  57. def emptyMatchSubst: Scalan.Subst

    Permalink
    Definition Classes
    Functions
    Annotations
    @inline()
  58. def endPass(pass: Scalan.Pass): Unit

    Permalink

    Called to let this IR context to finalized the given pass.

    Called to let this IR context to finalized the given pass.

    Definition Classes
    Transforming
  59. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  61. implicit def extendThunkElement[T](elem: Scalan.Elem[Scalan.Thunk[T]]): Scalan.ThunkElem[T]

    Permalink

    Implicit conversion (downcast) to access ThunkElem.eItem field.

  62. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  63. def findGlobalDefinition[T](d: Scalan.Def[T]): Scalan.Ref[T]

    Permalink

    Lookup definition in this IR context's hash table of definitions.

    Lookup definition in this IR context's hash table of definitions.

    returns

    node reference to an instance stored in hash table, which is equal to d and null if there is no definition which is equal to d

    Definition Classes
    Base
  64. def findOrCreateDefinition[T](d: Scalan.Def[T], newSym: ⇒ Scalan.Ref[T]): Scalan.Ref[T]

    Permalink

    Lookup d in the heap of nodes.

    Lookup d in the heap of nodes. If the lookup is successfull, then its reference is returned. If the node is not found in the heap, then it is added and d.self reference is returned.

    d

    node to be added to the head of nodes

    newSym

    producer of the reference to be used as the reference to d node.

    returns

    return a reference to d node in the heap

    Definition Classes
    Base
  65. def forceThunkByMirror[A](thunk: Scalan.Th[A], subst: Scalan.MapTransformer = MapTransformer.empty()): Scalan.Ref[A]

    Permalink

    Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).

    Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).

    thunk

    reference to the thunk node

    subst

    transformer to be applied for each mirrored (cloned) node.

    returns

    the reference to the graph node, which represents the resulting value of the thunk

  66. def forceThunkDefByMirror[A](th: Scalan.ThunkDef[A], subst: Scalan.MapTransformer = MapTransformer.empty()): Scalan.Ref[A]

    Permalink

    Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).

    Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).

    th

    the thunk node

    subst

    transformer to be applied for each mirrored (cloned) node.

    returns

    the reference to the graph node, which represents the resulting value of the thunk

  67. def formatConst(x: Any): String

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  68. def formatDef(d: Scalan.Def[_])(implicit config: GraphVizConfig): String

    Permalink
    Attributes
    protected
    Definition Classes
    ThunksGraphVizExport
  69. def formatMetadata(s: Scalan.Sym): List[String]

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  70. final def freshId: Int

    Permalink

    Get next fresh node id

    Get next fresh node id

    Definition Classes
    Base
    Annotations
    @inline()
  71. final def freshSym[T](d: Scalan.Def[T]): Scalan.Ref[T]

    Permalink

    Lookup of create reference to the given definition.

    Lookup of create reference to the given definition. To lookup d.nodeId is used as the index in the _symbolTable. If Ref is not found in _symbolTable, then new Ref instance is created and stored in _symbolTable at d.nodeId index.

    Definition Classes
    Base
    Annotations
    @inline()
  72. implicit final def fun[A, B](f: (Scalan.Ref[A]) ⇒ Scalan.Ref[B])(implicit eA: Scalan.LElem[A]): Scalan.Ref[(A) ⇒ B]

    Permalink

    Executes given lambda to construct Lambda node.

    Executes given lambda to construct Lambda node. The function f can be called with any symbol and has an effect of growing a graph starting from the argument symbol. If a reference to Variable node is passed as argument, then the constructed graph nodes can be collected to Lambda node forming its body and schedule.

    f

    function which execution will create body nodes

    eA

    arguments type descriptor

    Definition Classes
    Functions
  73. implicit final def fun2[A, B, C](f: (Scalan.Ref[A], Scalan.Ref[B]) ⇒ Scalan.Ref[C])(implicit eA: Scalan.LElem[A], eB: Scalan.LElem[B]): Scalan.Ref[((A, B)) ⇒ C]

    Permalink
    Definition Classes
    Functions
  74. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  75. def getEntityObject(name: String): Nullable[Scalan.EntityObject]

    Permalink
    Definition Classes
    Base
    Annotations
    @inline()
  76. def getOwnerKind(constructor: java.lang.reflect.Constructor[_]): Scalan.OwnerKind

    Permalink

    Returns OwnerKind for the given constructor, using its first parameter.

    Returns OwnerKind for the given constructor, using its first parameter.

    Attributes
    protected
    Definition Classes
    Base
  77. final def getSym(id: Int): Scalan.Sym

    Permalink

    Lookup node reference by its id.

    Lookup node reference by its id. This is simple array access by index O(1) operation.

    Definition Classes
    Base
    Annotations
    @inline()
  78. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  79. def identityFun[A](implicit e: Scalan.Elem[A]): Scalan.Ref[(A) ⇒ A]

    Permalink
    Definition Classes
    Functions
  80. var isInlineThunksOnForce: Boolean

    Permalink

    Specifies thunk staging strategy with respect to handling thunk_force operation.

    Specifies thunk staging strategy with respect to handling thunk_force operation.

    See also

    thunk_force

  81. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  82. var keepOriginalFunc: Boolean

    Permalink

    Global flag governing lambda reification in fun and mkLambda.

    Global flag governing lambda reification in fun and mkLambda. If this flag is true then original f: Ref[A] => Ref[B] function is stored in Lambda node. As a consequence if f is not stored, then unfoldLambda is done by mirrorLambda.

    Definition Classes
    Functions
  83. var lambdaStack: List[Scalan.Lambda[_, _]]

    Permalink
    Definition Classes
    Functions
  84. implicit def liftToRep[A](x: A)(implicit arg0: Scalan.Elem[A]): Scalan.Ref[A]

    Permalink
    Definition Classes
    Base
    Annotations
    @inline()
  85. implicit def liftableThunk[ST, T](implicit lT: Base.Liftables.Liftable[ST, T]): Base.Liftables.Liftable[Scalan.SThunk[ST], Scalan.Thunk[T]]

    Permalink
  86. def logWarn(msg: ⇒ String): Unit

    Permalink

    Log warning message to the log.

    Log warning message to the log. This is default and simple implementation, which can be overriden.

    Definition Classes
    Base
  87. def matchAny(a1: Any, a2: Any, allowInexactMatch: Boolean, subst: Scalan.Subst): Nullable[Scalan.Subst]

    Permalink
    Attributes
    protected
    Definition Classes
    Functions
  88. def matchDefs(d1: Scalan.Def[_], d2: Scalan.Def[_], allowInexactMatch: Boolean, subst: Scalan.Subst): Nullable[Scalan.Subst]

    Permalink
    Attributes
    protected
    Definition Classes
    ThunksFunctions
  89. def matchExps(s1: Scalan.Sym, s2: Scalan.Sym, allowInexactMatch: Boolean, subst: Scalan.Subst): Nullable[Scalan.Subst]

    Permalink
    Attributes
    protected
    Definition Classes
    Functions
  90. def matchIterators(i1: Iterator[_], i2: Iterator[_], allowInexactMatch: Boolean, subst: Scalan.Subst): Nullable[Scalan.Subst]

    Permalink
    Attributes
    protected
    Definition Classes
    Functions
  91. def mirrorApply[A, B](lam: Scalan.Lambda[A, B], s: Scalan.Ref[A]): Scalan.Ref[B]

    Permalink
    Definition Classes
    Functions
  92. def mkApply[A, B](f: Scalan.Ref[(A) ⇒ B], x: Scalan.Ref[A]): Scalan.Ref[B]

    Permalink
    Definition Classes
    Functions
  93. def mkLambda[A, B, C](f: (Scalan.Ref[A], Scalan.Ref[B]) ⇒ Scalan.Ref[C])(implicit eA: Scalan.LElem[A], eB: Scalan.LElem[B]): Scalan.Ref[((A, B)) ⇒ C]

    Permalink
    Definition Classes
    Functions
  94. def mkLambda[A, B, C](f: (Scalan.Ref[A]) ⇒ (Scalan.Ref[B]) ⇒ Scalan.Ref[C])(implicit eA: Scalan.LElem[A], eB: Scalan.Elem[B]): Scalan.Ref[(A) ⇒ (B) ⇒ C]

    Permalink
    Definition Classes
    Functions
  95. def mkLambda[A, B](f: (Scalan.Ref[A]) ⇒ Scalan.Ref[B], mayInline: Boolean, alphaEquality: Boolean, keepOriginalFunc: Boolean)(implicit eA: Scalan.LElem[A]): Scalan.Ref[(A) ⇒ B]

    Permalink
    Definition Classes
    Functions
  96. val nInitialDefs: Int

    Permalink
    Definition Classes
    Base
  97. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  98. def nodeColor(td: Scalan.TypeDesc, d: Scalan.Def[_])(implicit config: GraphVizConfig): String

    Permalink
    Attributes
    protected
    Definition Classes
    ThunksGraphVizExport
  99. def nodeColor(td: Scalan.TypeDesc): String

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  100. final def nodeLabel(parts: String*)(implicit config: GraphVizConfig): String

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  101. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  103. def onReset(): Unit

    Permalink

    Called during resetContext() operation after the core context state has been reset.

    Called during resetContext() operation after the core context state has been reset. Derived classes can override to define application specific initialization. Don't forget to call super method in the beginning of your overriding method.

    Attributes
    protected
    Definition Classes
    Base
  104. def partsIterator(td: Scalan.TypeDesc): TraversableOnce[Scalan.TypeDesc] { def seq: scala.collection.TraversableOnce[Thunks.this.TypeDesc]{def seq: scala.collection.TraversableOnce[Thunks.this.TypeDesc]{def seq: scala.collection.TraversableOnce[Thunks.this.TypeDesc]}} }

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  105. def patternMatch(s1: Scalan.Sym, s2: Scalan.Sym): Nullable[Scalan.Subst]

    Permalink
    Definition Classes
    Functions
  106. def placeholder[T](implicit eT: Scalan.LElem[T]): Scalan.Ref[T]

    Permalink
    Definition Classes
    Base
    Annotations
    @inline()
  107. def registerEntityObject(name: String, obj: Scalan.EntityObject): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    Base
  108. implicit def reifyObject[A](obj: Scalan.Def[A]): Scalan.Ref[A]

    Permalink

    Implicit injection of new definition (graph node) into universum of nodes with collapsing semantics.

    Implicit injection of new definition (graph node) into universum of nodes with collapsing semantics. If there exists node n in this IR such that obj equals n, then the value of n.self is returned, i.e. the new node obj is collapsed with already existing one. This has an effect of Common Subexpression Elimination (CSE) when an expression tree is transformed to the graph and identical subtrees are collapsed. After a reference to the node is obtained, global rewriting rules are examined and the reference may be replaced with a new one.

    Definition Classes
    Base
  109. implicit def repToThunk[A](block: Scalan.Ref[A]): Scalan.Ref[Scalan.Thunk[A]]

    Permalink
  110. def resetContext(): Unit

    Permalink
    Definition Classes
    Base
  111. def shouldEmitCluster(g: Scalan.AstGraph): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    GraphVizExport
  112. def showGraphs(graph: Scalan.AstGraph)(implicit config: GraphVizConfig): Unit

    Permalink
    Definition Classes
    GraphVizExport
  113. def showGraphs(roots: Scalan.Sym*)(implicit config: GraphVizConfig): Unit

    Permalink
    Definition Classes
    GraphVizExport
  114. def stagingExceptionMessage(message: String, syms: Seq[Scalan.Ref[_]]): String

    Permalink

    Prettyprint exception message

    Prettyprint exception message

    Attributes
    protected
    Definition Classes
    Base
  115. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  116. implicit val thunkCont: Scalan.Cont[Scalan.Thunk]

    Permalink

    Thunk is an instance of container type class Cont.

  117. implicit def thunkElement[T](implicit eItem: Scalan.Elem[T]): Scalan.Elem[Scalan.Thunk[T]]

    Permalink
  118. val thunkStack: Scalan.ThunkStack

    Permalink
    Attributes
    protected
  119. def thunk_create[A](block: ⇒ Scalan.Ref[A]): Scalan.Ref[Scalan.Thunk[A]]

    Permalink

    Constructs a new thunk node by executing the given block and collecting all the graph node created along the way.

    Constructs a new thunk node by executing the given block and collecting all the graph node created along the way. This methods: 1) starts a new nested ThunkScope, 2) executes the block to obtain resulting graph node 3) schedule thunk body for execution order 4) adds a new ThunkDef node and returns its reference.

    returns

    a reference to the newly created ThunkDef node

  120. def thunk_force[A](t: Scalan.Th[A]): Scalan.Ref[A]

    Permalink

    Logical force of the thunk.

    Logical force of the thunk. Depending on isInlineThunksOnForce it either inlines the thunk body or creates a new ThunkForce node.

    returns

    a reference to the graph node, which represent the result of the thunk's evaluation.

  121. def thunk_map[A, B](t: Scalan.Th[A], f: Scalan.Ref[(A) ⇒ B]): Scalan.Th[B]

    Permalink
  122. def thunk_map1[A, B](t: Scalan.Th[A], f: (Scalan.Ref[A]) ⇒ Scalan.Ref[B]): Scalan.Th[B]

    Permalink
  123. def toExp[T](d: Scalan.Def[T], newSym: ⇒ Scalan.Ref[T]): Scalan.Ref[T]

    Permalink

    Updates the universe of symbols and definitions, then rewrites until fix-point

    Updates the universe of symbols and definitions, then rewrites until fix-point

    d

    A new graph node to add to the universe

    newSym

    A symbol that will be used if d doesn't exist in the universe

    returns

    The symbol of the graph which is semantically(up to rewrites) equivalent to d

    Attributes
    protected[scalan]
    Definition Classes
    Base
  124. def toRep[A](x: A)(implicit eA: Scalan.Elem[A]): Scalan.Ref[A]

    Permalink

    Lifting of data values to IR nodes.

    Lifting of data values to IR nodes.

    Definition Classes
    Base
  125. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  126. def transformProductParam(x: Any, t: Scalan.Transformer): Any

    Permalink

    Transforms this object into new one by applying t to every Ref inside its structure.

    Transforms this object into new one by applying t to every Ref inside its structure. The structure is build out of Seq, Array, Option and Def values. Other structure items remain unchanged and copied to the new instance.

    Attributes
    protected
    Definition Classes
    Base
  127. def unfoldLambda[A, B](f: Scalan.Ref[(A) ⇒ B], x: Scalan.Ref[A]): Scalan.Ref[B]

    Permalink
    Definition Classes
    Functions
  128. def unfoldLambda[A, B](lam: Scalan.Lambda[A, B], x: Scalan.Ref[A]): Scalan.Ref[B]

    Permalink
    Definition Classes
    Functions
  129. var unfoldWithOriginalFunc: Boolean

    Permalink

    Turns on/off lambda unfolding using original function f stored in the Lambda node.

    Turns on/off lambda unfolding using original function f stored in the Lambda node. If this flag is false then this function cannot be used even if it is present in the node.

    Definition Classes
    Functions
  130. def upcastFun[A, B >: A](implicit arg0: Scalan.Elem[A]): Scalan.Ref[(A) ⇒ B]

    Permalink
    Definition Classes
    Functions
  131. final def updateSymbolTable[T](s: Scalan.Ref[T], d: Scalan.Def[T]): Scalan.Ref[T]

    Permalink

    Create or find symbol (node Ref) which refers to the given node in the table of all created symbols.

    Create or find symbol (node Ref) which refers to the given node in the table of all created symbols. The d.nodeId is the index in the _symbolTable which is DBuffer (backed by Array)

    returns

    new of existing symbol

    Definition Classes
    Base
  132. var useAlphaEquality: Boolean

    Permalink

    Global lambda equality mode used by default.

    Global lambda equality mode used by default. It is used in fun and fun2 lambda builders. If this flag is true then Lambda nodes are equal if they are the same up to renaming of symbols. (see Lambda.equals()). Each Lambda node has independent equality mode flag which is setup in the constructor.

    Definition Classes
    Functions
  133. final def valueFromRep[A](x: Scalan.Ref[A]): A

    Permalink

    Extract data value from Const node or throw an exception.

    Extract data value from Const node or throw an exception.

    Definition Classes
    Base
    Annotations
    @inline()
  134. def variable[T](implicit eT: Scalan.LElem[T]): Scalan.Ref[T]

    Permalink
    Definition Classes
    Base
    Annotations
    @inline()
  135. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from GraphVizExport

Inherited from Functions

Inherited from ProgramGraphs

Inherited from AstGraphs

Inherited from Transforming

Inherited from Base

Inherited from AnyRef

Inherited from Any

Ungrouped