示例#1
0
文件: cgo13.py 项目: ChrisCummins/phd
    def from_csv(path, group_by=None, filter_by=None):
        datafilter = {
            "suite": suite_filter
        }.get(filter_by, None)

        getgroup = {
            "class": getclass,
            "suite": getsuite,
            "prog": getprog,
            "benchmark": getbenchmark,
        }.get(group_by, lambda x: "None")

        data = pd.read_csv(smith.assert_exists(path))

        if datafilter:
            # TODO: data filter
            pass

        # Add group column.
        data["Group"] = [getgroup(d) for d in data.to_dict(orient='records')]

        # If data is labelled.
        if "F1:transfer/(comp+mem)" in data:
            # Add normalized feature columns.
            data["F1_norm"] = normalize(data["F1:transfer/(comp+mem)"])
            data["F2_norm"] = normalize(data["F2:coalesced/mem"])
            data["F3_norm"] = normalize(data["F3:(localmem/mem)*avgws"])
            data["F4_norm"] = normalize(data["F4:comp/mem"])

            # Add eigenvectors.
            data["E1"], data["E2"], data["E3"], data["E4"] = _eigenvectors(data)

        return data
示例#2
0
文件: cgo13.py 项目: ChrisCummins/phd
    def from_csv(path):
        data = pd.read_csv(smith.assert_exists(path),
                           names=["benchmark", "dataset", "kernel",
                                  "wgsize", "transfer", "runtime", "ci"])

        return data
示例#3
0
def opt():
    return smith.assert_exists(llvm_path(), "build", "bin", "opt",
                               exception=ConfigException)
示例#4
0
def clang():
    return smith.assert_exists(llvm_path(), "build", "bin", "clang",
                               exception=ConfigException)
示例#5
0
def rewriter():
    return smith.assert_exists(phd_root(), "src", "smith", "native", "rewriter",
                               exception=ConfigException)
示例#6
0
def llvm_path():
    return smith.assert_exists(phd_root(), "tools", "llvm",
                               exception=ConfigException)
示例#7
0
def libclc():
    return smith.assert_exists(phd_root(), "extern", "libclc",
                               exception=ConfigException)
示例#8
0
def clsmith():
    return smith.assert_exists(clsmith_path(), "build", "CLSmith",
                               exception=ConfigException)
示例#9
0
def clsmith_path():
    return smith.assert_exists("~/phd/extern/clsmith",
                               exception=ConfigException)
示例#10
0
 def verify_parboil(path):
     smith.assert_exists(path, exception=ConfigException)
     smith.assert_exists(path, 'benchmarks', exception=ConfigException)
     smith.assert_exists(path, 'datasets', exception=ConfigException)
     smith.assert_exists(path, 'parboil', exception=ConfigException)
     return path
示例#11
0
def torch_rnn_path():
    return smith.assert_exists("~/src/torch-rnn", exception=ConfigException)
示例#12
0
def phd_root():
    return smith.assert_exists("~/phd", exception=ConfigException)