Exemplo n.º 1
0
    def actions_for_project(self, project):
        project = polyjit.PolyJIT.init_project(project)
        project.run_uuid = uuid.uuid4()
        jobs = int(settings.CFG["jobs"].value)
        project.cflags += [
            "-Rpass-missed=polli*", "-mllvm", "-stats", "-mllvm",
            "-polly-num-threads={0}".format(jobs)
        ]

        cfg_with_jit = {
            'jobs': jobs,
            "cflags": project.cflags,
            "cores": str(jobs - 1),
            "cores-config": str(jobs),
            "recompilation": "enabled",
            "specialization": "enabled"
        }

        cfg_without_jit = {
            'jobs': jobs,
            "cflags": project.cflags,
            "cores": str(jobs - 1),
            "cores-config": str(jobs),
            "recompilation": "enabled",
            "specialization": "disabled"
        }

        jit = extensions.run.RuntimeExtension(project,
                                              self,
                                              config=cfg_with_jit)
        enable_jit = polyjit.EnablePolyJIT(jit)

        no_jit = extensions.run.RuntimeExtension(project,
                                                 self,
                                                 config=cfg_without_jit)
        disable_jit = polyjit.EnablePolyJIT(no_jit)

        pjit_extension = extensions.Extension(
            EnableDBExport(enable_jit) \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.RegisterPolyJITLogs() \
            << extensions.log.LogAdditionals() \
            << polyjit.ClearPolyJITConfig(),
            EnableDBExport(disable_jit) \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.RegisterPolyJITLogs() \
            << extensions.log.LogAdditionals() \
            << polyjit.ClearPolyJITConfig())

        project.runtime_extension = extensions.time.RunWithTime(pjit_extension)
        return JitExportGeneratedCode.default_runtime_actions(project)
Exemplo n.º 2
0
    def actions_for_project(self, project):
        project = polyjit.PolyJIT.init_project(project)
        project.run_uuid = uuid.uuid4()
        jobs = int(settings.CFG["jobs"].value)
        project.cflags += [
            "-mllvm", "-stats", "-mllvm", "-polly-num-threads={0}".format(jobs)
        ]

        project.ldflags += ["-lgomp"]

        enable_jit = RuntimeExtension(
            project, self, config={
                "name": "PolyJIT",
                "cores": jobs
            }) \
            << polyjit.EnablePolyJIT() \
            << EnableDBExport() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.RegisterPolyJITLogs() \
            << LogAdditionals() \
            << polyjit.ClearPolyJITConfig()

        disable_jit = RuntimeExtension(
            project, self, config={
                "name": "polly.inside",
                "cores": jobs
            }) \
            << polyjit.DisablePolyJIT() \
            << EnableDBExport() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.RegisterPolyJITLogs() \
            << LogAdditionals() \
            << polyjit.ClearPolyJITConfig()

        project.runtime_extension = Extension(enable_jit, disable_jit)

        return JitExportGeneratedCode.default_runtime_actions(project)
Exemplo n.º 3
0
    def actions_for_project(self, project):

        project = polyjit.PolyJIT.init_project(project)

        actns = []
        for i in range(2, int(str(CFG["jobs"])) + 1):
            cp = copy.deepcopy(project)
            cp.run_uuid = uuid.uuid4()
            cp.cflags += ["-mllvm", "-polly-num-threads={0}".format(i)]
            cp.runtime_extension = \
                extensions.run.RuntimeExtension(
                    cp, self, config={
                        "jobs": i,
                        "cores": str(i-1),
                        "cores-config": str(i),
                        "recompilation": "enabled"}) \
                << polyjit.EnablePolyJIT() \
                << polyjit.ClearPolyJITConfig() \
                << extensions.time.RunWithTime() \
                << polyjit.RegisterPolyJITLogs() \
                << extensions.log.LogAdditionals()

            actns.extend(self.default_runtime_actions(cp))
        return actns
Exemplo n.º 4
0
    def actions_for_project(self, project):
        jobs = int(settings.CFG["jobs"].value)
        naked_project = project.clone()
        naked_project.cflags += ["-O3"]

        naked_polly_project = project.clone()
        naked_polly_project.cflags += [
            "-Xclang", "-load", "-Xclang", "LLVMPolly.so", "-O3", "-mllvm",
            "-polly", "-mllvm", "-polly-parallel", "-fopenmp"
        ]

        project = polyjit.PolyJIT.init_project(project)
        project.cflags += [
            "-mllvm", "-polly-num-threads={0}".format(jobs), "-fopenmp"
        ]
        project.ldflags += ["-lgomp"]

        ext_jit_opt = RuntimeExtension(
            project, self, config={
                "name": "PolyJIT_Opt",
                "cores": jobs,
            }) \
            << polyjit.EnablePolyJIT_Opt() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.CollectMetrics(project=project) \
            << polyjit.PolyJITMetrics() \
            << polyjit.RegisterPolyJITLogs() \
            << polyjit.ClearPolyJITConfig()

        ext_jit = RuntimeExtension(
            project, self, config={
                "name": "PolyJIT",
                "cores": jobs,
            }) \
            << polyjit.EnablePolyJIT() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.CollectMetrics(project=project) \
            << polyjit.PolyJITMetrics() \
            << polyjit.RegisterPolyJITLogs() \
            << polyjit.ClearPolyJITConfig()

        ext_jit_polly = RuntimeExtension(
            project, self, config={
                "name": "polly.inside",
                "cores": jobs
            }) \
            << polyjit.DisablePolyJIT() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.CollectMetrics(project=project) \
            << polyjit.PolyJITMetrics() \
            << polyjit.RegisterPolyJITLogs() \
            << polyjit.ClearPolyJITConfig()

        ext_jit_no_delin = RuntimeExtension(
            project, self, config={
                "name": "PolyJIT.no-delin",
                "cores": jobs
            }) \
            << polyjit.DisableDelinearization() \
            << polyjit.EnablePolyJIT() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.CollectMetrics(project=project) \
            << polyjit.PolyJITMetrics() \
            << polyjit.RegisterPolyJITLogs() \
            << polyjit.ClearPolyJITConfig()

        ext_jit_polly_no_delin = RuntimeExtension(
            project, self, config={
                "name": "polly.inside.no-delin",
                "cores": jobs
            }) \
            << polyjit.DisableDelinearization() \
            << polyjit.DisablePolyJIT() \
            << polyjit.EnableJITTracking(project=project) \
            << polyjit.CollectMetrics(project=project) \
            << polyjit.PolyJITMetrics() \
            << polyjit.RegisterPolyJITLogs() \
            << polyjit.ClearPolyJITConfig()

        # JIT configurations:
        #   PolyJIT, polly.inside,
        #   PolyJIT_Opt, polly.inside.no-delin
        project.runtime_extension = Extension(
            ext_jit_opt, ext_jit, ext_jit_polly, ext_jit_no_delin,
            ext_jit_polly_no_delin) << RunWithTime()

        # O3
        naked_project.runtime_extension = RuntimeExtension(
            naked_project, self, config={
                "name": "o3.naked",
                "cores": jobs
            }) \
            << RunWithTime()

        # Polly
        naked_polly_project.runtime_extension = RuntimeExtension(
            naked_polly_project, self, config={
                "name": "polly.naked",
                "cores": jobs
            }) \
            << RunWithTime()

        def ijpp_config(_project, name):
            return actions.RequireAll(actions=[
                actions.Echo("Stage: JIT Configurations"),
                actions.MakeBuildDir(_project),
                actions.Compile(_project),
                actions.Run(_project),
                actions.Clean(_project),
                actions.Echo(name),
            ])

        return [
            actions.Any(actions=[
                ijpp_config(project, "Stage: JIT Configurations"),
                ijpp_config(naked_project, "Stage: O3"),
                ijpp_config(naked_polly_project, "Stage: O3 Polly")
            ])
        ]