def get_compiled_mfsim(self, tree, file):
        BasicBlock.id_counter = 1
        ir = self.get_ir(tree)
        ir = Program(functions=ir.functions,
                     config=CompilerCLI([
                         "-d", "-inline", "-t", "mfsim", "-i", file, "-o",
                         "output/"
                     ]).config,
                     symbol_table=ir.symbol_table,
                     bb_graph=ir.graph,
                     name=file,
                     calls=ir.calls)
        pm = PassManager(ir)
        pm.run_analysis()
        pm.run_transformations()
        prog = pm.program

        target = MFSimTarget(prog)
        target.transform()
        return str([
            target.num_cgs, target.num_transfers, target.num_dags,
            target.num_detects, target.num_dispense, target.num_dispose,
            target.num_edges, target.num_heats, target.num_mixes,
            target.num_splits, target.expid
        ])
Beispiel #2
0
    def get_volume(self, tree, file):
        ir = self.get_ir(tree)
        ir = Program(functions=ir.functions, config=CompilerCLI(["-d", "-tv", "-i", file, "-o", "output/"]).config,
                       symbol_table=ir.symbol_table, bb_graph=ir.graph, name=file, calls=ir.calls)
        pm = PassManager(ir)
        pm.run_analysis()
        pm.run_transformations()
        prog = pm.program

        return prog.analysis['volume_tracking']
Beispiel #3
0
    def get_compiled_ir(self, tree):
        # This resets the basic block counter right before we
        # traverse the IR visitor.  This makes testing for
        # basic block id deterministic and independent of
        # the order in which tests are run.
        BasicBlock.id_counter = 1
        ir = self.get_ir(tree)

        expander = SIMDExpansion()
        target = IRTarget(expander.transform(Program(functions=ir.functions, symbol_table=ir.symbol_table,
                                  bb_graph=ir.graph, name="TEST_FILE", calls=ir.calls,
                                  config=CompilerCLI(["-d", "-t", "ir", "-i", "TEST_FILE"]).config)))
        target.transform()
        return target
Beispiel #4
0
 def _get_config(args: str):
     if not args:
         args = "-t ir -d -i TEST_FILE"
     cli = CompilerCLI(args)
     return cli.config
Beispiel #5
0
def main(args):
    # parse the args.
    cli = CompilerCLI(args)
    compiler = BSCompiler(cli.config)
    compiler.compile()