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
def from_csv(path): data = pd.read_csv(smith.assert_exists(path), names=["benchmark", "dataset", "kernel", "wgsize", "transfer", "runtime", "ci"]) return data
def opt(): return smith.assert_exists(llvm_path(), "build", "bin", "opt", exception=ConfigException)
def clang(): return smith.assert_exists(llvm_path(), "build", "bin", "clang", exception=ConfigException)
def rewriter(): return smith.assert_exists(phd_root(), "src", "smith", "native", "rewriter", exception=ConfigException)
def llvm_path(): return smith.assert_exists(phd_root(), "tools", "llvm", exception=ConfigException)
def libclc(): return smith.assert_exists(phd_root(), "extern", "libclc", exception=ConfigException)
def clsmith(): return smith.assert_exists(clsmith_path(), "build", "CLSmith", exception=ConfigException)
def clsmith_path(): return smith.assert_exists("~/phd/extern/clsmith", exception=ConfigException)
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
def torch_rnn_path(): return smith.assert_exists("~/src/torch-rnn", exception=ConfigException)
def phd_root(): return smith.assert_exists("~/phd", exception=ConfigException)