Beispiel #1
0
    def actions_for_project(self, project):
        """
        Create & Run a papi-instrumented version of the project.

        This experiment uses the -jitable flag of libPolyJIT to generate
        dynamic SCoP coverage.
        """
        project.ldflags = project.ldflags + ["-lpjit", "-lpprof", "-lpapi"]
        project.cflags = [
            "-O3", "-Xclang", "-load", "-Xclang", "LLVMPolyJIT.so", "-mllvm",
            "-polli", "-mllvm", "-polli-instrument", "-mllvm",
            "-polli-no-recompilation", "-mllvm", "-polly-detect-keep-going"
        ]
        project.compiler_extension = \
            run.WithTimeout(compilestats.ExtractCompileStats(project, self))
        project.runtime_extension = \
            time.RunWithTime(
                run.RuntimeExtension(project, self, config={'jobs': 1}))

        def evaluate_calibration(e):
            from benchbuild.utils.cmd import pprof_calibrate
            papi_calibration = e.get_papi_calibration(pprof_calibrate)
            e.persist_calibration(project, pprof_calibrate, papi_calibration)

        actns = self.default_runtime_actions(project)
        actns.append(Calibrate(self, evaluate_calibration))
        return self.default_runtime_actions(project)
Beispiel #2
0
    def actions_for_project(self, project):
        """Compile & Run the experiment with -O3 enabled."""
        project.cflags = [
            "-O3",
            "-fno-omit-frame-pointer",
            "-mllvm",
            "-polly",
            "-mllvm",
            "-polly-enable-mse",
            "-mllvm",
            "-polly-process-unprofitable",
            "-mllvm",
            "-polly-enable-optree=0",
            "-mllvm",
            "-polly-enable-delicm=0",
        ]
        project.compiler_extension = \
            extensions.run.WithTimeout(compilestats.ExtractCompileStats(project, self))
        project.runtime_extension = \
            MeasureTimeAndMemory(
                extensions.run.RuntimeExtension(project, self,
                                     config={
                                         'jobs': int(CFG["jobs"].value)}))

        return self.default_runtime_actions(project)
Beispiel #3
0
    def actions_for_project(self, project):
        import copy
        import uuid

        no_pgo_project = copy.deepcopy(project)
        no_pgo_project.run_uuid = uuid.uuid4()
        pgo_project = copy.deepcopy(project)
        pgo_project.run_uuid = uuid.uuid4()

        project.cflags += ["-O3", "-fprofile-generate=./raw-profiles"]
        cfg_inst = {"cflags": project.cflags, "name": "inst"}
        project.compiler_extension = \
            extensions.compiler.RunCompiler(project, self, config=cfg_inst) \
            << extensions.run.WithTimeout()
        project.runtime_extension = \
            extensions.run.RuntimeExtension(project, self, config=cfg_inst)

        # Still activating pgo for clang pgo optimisation
        no_pgo_project.cflags += [
            "-O3", "-fprofile-use=./raw-profiles", "-mllvm", "-polly",
            "-mllvm", "-stats"
        ]
        cfg_no_pgo = {"cflags": no_pgo_project.cflags, "name": "no-pgo"}
        no_pgo_project.compiler_extension = \
            compilestats.ExtractCompileStats(project, self, config=cfg_no_pgo) \
            << extensions.run.WithTimeout()

        pgo_project.cflags += [
            "-O3", "-fprofile-use=./raw-profiles", "-mllvm", "-polly",
            "-mllvm", "-polly-pgo-enable"
            "-mllvm", "-stats"
        ]
        cfg_pgo = {"cflags": pgo_project.cflags, "name": "pgo"}
        pgo_project.compiler_extension = \
            extensions.run.RuntimeExtension(project, self) \
            << extensions.time.RunWithTime(config=cfg_pgo)

        actns = [
            actions.RequireAll(actions=[
                actions.MakeBuildDir(project),
                actions.Compile(project),
                actions.Run(project),
                SaveProfile(project, filename='prog.profdata'),
                actions.Clean(project),
            ]),
            actions.RequireAll(actions=[
                actions.MakeBuildDir(no_pgo_project),
                actions.Compile(no_pgo_project),
                actions.Run(no_pgo_project),
                actions.Clean(no_pgo_project)
            ]),
            actions.RequireAll(actions=[
                actions.MakeBuildDir(pgo_project),
                RetrieveFile(pgo_project,
                             filename="prog.profdata",
                             run_group=project.run_uuid),
                actions.Compile(pgo_project),
                actions.Run(pgo_project),
                actions.Clean(pgo_project)
            ])
        ]
        return actns
    def actions_for_project(self, project):
        actns = []
        project.cflags = ["-Xclang", "-load", "-Xclang", "LLVMPolly.so"]

        newp = copy.deepcopy(project)
        newp.run_uuid = uuid.uuid4()
        newp.cflags = newp.cflags + ["-O3"]
        cfg = {"name": "-O3"}
        newp.compiler_extension = \
            compilestats.ExtractCompileStats(newp, self, config=cfg) \
            << run.WithTimeout() \
            << statistics.Statistics(newp, self, config=cfg)
        actns.extend(self.default_compiletime_actions(newp))

        newp = copy.deepcopy(project)
        newp.run_uuid = uuid.uuid4()
        newp.cflags = newp.cflags + ["-O3", "-mllvm", "-polly"]
        cfg = {"name": "-O3 -polly"}
        newp.compiler_extension = \
            compilestats.ExtractCompileStats(newp, self, config=cfg) \
            << run.WithTimeout()\
            << statistics.Statistics(newp, self, config=cfg)
        actns.extend(self.default_compiletime_actions(newp))

        newp = copy.deepcopy(project)
        newp.run_uuid = uuid.uuid4()
        newp.cflags = newp.cflags + [
            "-O3", "-mllvm", "-polly", "-mllvm",
            "-polly-position=before-vectorizer"
        ]
        cfg = {"name": "-O3 -polly -polly-position=before-vectorizer"}
        newp.compiler_extension = \
            compilestats.ExtractCompileStats(newp, self, config=cfg) \
            << run.WithTimeout() \
            << statistics.Statistics(newp, self, config=cfg)
        actns.extend(self.default_compiletime_actions(newp))

        newp = copy.deepcopy(project)
        newp.run_uuid = uuid.uuid4()
        newp.cflags = newp.cflags + [
            "-O3", "-mllvm", "-polly", "-mllvm", "-polly-process-unprofitable",
            "-mllvm", "-polly-position=before-vectorizer"
        ]
        cfg = {
            "name":
            "-O3 -polly -polly-position=before-vectorizer "
            "-polly-process-unprofitable"
        }
        newp.compiler_extension = \
            compilestats.ExtractCompileStats(newp, self, config=cfg) \
            << run.WithTimeout() \
            << statistics.Statistics(newp, self, config=cfg)
        actns.extend(self.default_compiletime_actions(newp))

        newp = copy.deepcopy(project)
        newp.run_uuid = uuid.uuid4()
        newp.cflags = newp.cflags + [
            "-O3", "-mllvm", "-polly", "-mllvm", "-polly-process-unprofitable"
        ]
        cfg = {"name": "-O3 -polly -polly-process-unprofitable"}
        newp.compiler_extension = \
            compilestats.ExtractCompileStats(newp, self, config=cfg) \
            << run.WithTimeout() \
            << statistics.Statistics(newp, self, config=cfg)
        actns.extend(self.default_compiletime_actions(newp))
        return actns
Beispiel #5
0
 def actions_for_project(self, project):
     project = polyjit.PolyJIT.init_project(project)
     project.compiler_extension = \
         run.WithTimeout(compilestats.ExtractCompileStats(project, self))
     return self.default_compiletime_actions(project)