Пример #1
0
    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
    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)