Package org.apache.sysds.hops.codegen

# Class SpoofCompiler

java.lang.Object
org.apache.sysds.hops.codegen.SpoofCompiler

public class SpoofCompiler extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`SpoofCompiler.CompilerType`
`static enum`
`SpoofCompiler.GeneratorAPI`
`static enum`
`SpoofCompiler.IntegrationType`
`static enum`
`SpoofCompiler.PlanCachePolicy`
`static enum`
`SpoofCompiler.PlanSelector`
`static enum`
`SpoofCompiler.RegisterAlloc`

## Field Summary

Fields
Modifier and Type
Field
Description
`static SpoofCompiler.GeneratorAPI`
`API`
`static final SpoofCompiler.IntegrationType`
`INTEGRATION`
`static SpoofCompiler.CompilerType`
`JAVA_COMPILER`
`static HashMap<SpoofCompiler.GeneratorAPI,Long>`
`native_contexts`
`static SpoofCompiler.PlanCachePolicy`
`PLAN_CACHE_POLICY`
`static final int`
`PLAN_CACHE_SIZE`
`static SpoofCompiler.PlanSelector`
`PLAN_SEL_POLICY`
`static final boolean`
`PRUNE_REDUNDANT_PLANS`
`static final boolean`
`RECOMPILE_CODEGEN`
`static final SpoofCompiler.RegisterAlloc`
`REG_ALLOC_POLICY`

## Constructor Summary

Constructors
Constructor
Description
`SpoofCompiler()`

## Method Summary

Modifier and Type
Method
Description
`static void`
`cleanupCodeGenerator()`
`static PlanSelection`
`createPlanSelector()`
Factory method for alternative plan selection policies.
`static void`
`generateCode(DMLProgram dmlprog)`
`static void`
`generateCode(Program rtprog)`
`static ArrayList<Hop>`
`generateCodeFromHopDAGs(ArrayList<Hop> roots)`
`static ArrayList<Instruction>`
`generateCodeFromHopDAGsToInst(Hop root)`
`static ArrayList<Instruction>`
`generateCodeFromHopDAGsToInst(StatementBlock sb, ArrayList<Hop> roots)`
`static void`
`generateCodeFromProgramBlock(ProgramBlock current)`
`static void`
`generateCodeFromStatementBlock(StatementBlock current)`
`static void`
`loadNativeCodeGenerator(SpoofCompiler.GeneratorAPI generator)`
`static ArrayList<Hop>`
`optimize(ArrayList<Hop> roots, boolean recompile)`
Main interface of sum-product optimizer, statement block dag.
`static Hop`
`optimize(Hop root, boolean recompile)`
Main interface of sum-product optimizer, predicate dag.
`static void`
`setConfiguredPlanSelector()`
`static void`
`setExecTypeSpecificJavaCompiler()`
`static void`
`unloadNativeCodeGenerator()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### JAVA_COMPILER

public static SpoofCompiler.CompilerType JAVA_COMPILER

### PLAN_SEL_POLICY

public static SpoofCompiler.PlanSelector PLAN_SEL_POLICY

### INTEGRATION

public static final SpoofCompiler.IntegrationType INTEGRATION

### RECOMPILE_CODEGEN

public static final boolean RECOMPILE_CODEGEN

See Also:
  - Constant Field Values

### PRUNE_REDUNDANT_PLANS

public static final boolean PRUNE_REDUNDANT_PLANS

See Also:
  - Constant Field Values

### PLAN_CACHE_POLICY

public static SpoofCompiler.PlanCachePolicy PLAN_CACHE_POLICY

### PLAN_CACHE_SIZE

public static final int PLAN_CACHE_SIZE

See Also:
  - Constant Field Values

### REG_ALLOC_POLICY

public static final SpoofCompiler.RegisterAlloc REG_ALLOC_POLICY

### API

public static SpoofCompiler.GeneratorAPI API

### native_contexts

public static HashMap<SpoofCompiler.GeneratorAPI,Long> native_contexts

## Constructor Details

### SpoofCompiler

public SpoofCompiler()

## Method Details

### loadNativeCodeGenerator

public static void loadNativeCodeGenerator(SpoofCompiler.GeneratorAPI generator)

### unloadNativeCodeGenerator

public static void unloadNativeCodeGenerator()

### generateCode

public static void generateCode(DMLProgram dmlprog)

### generateCode

public static void generateCode(Program rtprog)

### generateCodeFromStatementBlock

public static void generateCodeFromStatementBlock(StatementBlock current)

### generateCodeFromProgramBlock

public static void generateCodeFromProgramBlock(ProgramBlock current)

### generateCodeFromHopDAGs

public static ArrayList<Hop> generateCodeFromHopDAGs(ArrayList<Hop> roots)

### generateCodeFromHopDAGsToInst

public static ArrayList<Instruction> generateCodeFromHopDAGsToInst(StatementBlock sb, ArrayList<Hop> roots)

### generateCodeFromHopDAGsToInst

public static ArrayList<Instruction> generateCodeFromHopDAGsToInst(Hop root)

### optimize

public static Hop optimize(Hop root, boolean recompile)
Main interface of sum-product optimizer, predicate dag.

Parameters:
  `root` - dag root node
  `recompile` - true if invoked during dynamic recompilation
Returns:
  dag root node of modified dag

### optimize

public static ArrayList<Hop> optimize(ArrayList<Hop> roots, boolean recompile)
Main interface of sum-product optimizer, statement block dag.

Parameters:
  `roots` - dag root nodes
  `recompile` - true if invoked during dynamic recompilation
Returns:
  dag root nodes of modified dag

### cleanupCodeGenerator

public static void cleanupCodeGenerator()

### createPlanSelector

public static PlanSelection createPlanSelector()
Factory method for alternative plan selection policies.

Returns:
  plan selector

### setConfiguredPlanSelector

public static void setConfiguredPlanSelector()

### setExecTypeSpecificJavaCompiler

public static void setExecTypeSpecificJavaCompiler()