def run(path, option): if option == "dpc": app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") option = "cpu" p = subprocess.Popen(["./cl_hot_kernels", app_file, option, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) elif option == "omp": app_folder = utils.get_sample_build_path("omp_gemm") app_file = os.path.join(app_folder, "omp_gemm") option = "gpu" e = utils.add_env(None, "LIBOMPTARGET_PLUGIN", "OPENCL") p = subprocess.Popen(["./cl_hot_kernels", app_file, option, "1024", "1"],\ env = e, cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("cl_gemm") app_file = os.path.join(app_folder, "cl_gemm") p = subprocess.Popen(["./cl_hot_kernels", app_file, option, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stdout: return stderr if stdout.find(" CORRECT") == -1: return stdout if not parse(stderr): return stderr return None
def run(path, option): if option == "cl": app_folder = utils.get_sample_build_path("cl_gemm") app_file = os.path.join(app_folder, "cl_gemm") p = subprocess.Popen(["./gpu_inst_count", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) elif option == "ze": app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./gpu_inst_count", app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") p = subprocess.Popen(["./gpu_inst_count", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stderr: return stdout if stdout.find(" CORRECT") == -1: return stdout if stderr.find("add") == -1 or stderr.find("mov") == -1 or stderr.find( "send") == -1: return stderr if not parse(stderr): return stderr return None
def run(path, option): if option == "dpc": app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") p = subprocess.Popen(["./cl_tracer", "-h", "-d", "-t", app_file, "cpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) elif option == "omp": app_folder = utils.get_sample_build_path("omp_gemm") app_file = os.path.join(app_folder, "omp_gemm") e = utils.add_env(None, "LIBOMPTARGET_PLUGIN", "OPENCL") p = subprocess.Popen(["./cl_tracer", "-h", "-d", "-t", app_file, "gpu", "1024", "1"],\ env = e, cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("cl_gemm") app_file = os.path.join(app_folder, "cl_gemm") if option == "gpu": p = subprocess.Popen(["./cl_tracer", "-h", "-d", "-t", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: p = subprocess.Popen(["./cl_tracer", option, app_file, "cpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stdout: return "stdout is empty" if not stderr: return "stderr is empty" if stdout.find(" CORRECT") == -1: return stdout if stderr.find("WARNING") != -1: return stderr return None
def run(path, option): if option == "dpc": app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") p = subprocess.Popen(["./ze_tracer", "-h", "-d", "-t", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) elif option == "omp": app_folder = utils.get_sample_build_path("omp_gemm") app_file = os.path.join(app_folder, "omp_gemm") p = subprocess.Popen(["./ze_tracer", "-h", "-d", "-t", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./ze_tracer", option, app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stdout: return "stdout is empty" if not stderr: return "stderr is empty" if stdout.find(" CORRECT") == -1: return stdout if stderr.find("WARNING") != -1: return stderr return None
def run(path, option): if option == "dpc": app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") p = subprocess.Popen(["./ze_debug_info", app_file, "gpu", "1024", "1"], cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./ze_debug_info", app_file, "1024", "1"], cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stdout: return "stdout is empty" if not stderr: return "stderr is empty" if stdout.find(" CORRECT") == -1: return stdout if stderr.find("for") == -1: return stderr if stderr.find("add") == -1 or stderr.find("mov") == -1 or stderr.find( "send") == -1: return stderr return None
def main(option): path = utils.get_sample_build_path("cl_hot_kernels") if option == "dpc": log = dpc_gemm.main("cpu") if log: return log elif option == "omp": log = omp_gemm.main("gpu") if log: return log else: log = cl_gemm.main(option) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log log = run(path, option) if log: return log
def run(path, option): if option == "dpc": app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") p = subprocess.Popen(["./ze_metric_query", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./ze_metric_query", app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stdout: return stderr if stdout.find(" CORRECT") == -1: return stdout if not parse(stderr): return stderr return None
def main(option): path = utils.get_sample_build_path("gpu_perfmon_set") log = config(path) if log: return log log = build(path) if log: return log log = run(path) if log: return log
def main(option): path = utils.get_sample_build_path("dpc_info") log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def main(option): path = utils.get_sample_build_path("ze_sysman") log = config(path) if log: return log log = build(path) if log: return log log = run(path) if log: return log
def main(option): path = utils.get_sample_build_path("cl_gemm_itt") log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def run(path, option): if option == "dpc": app_folder = utils.get_sample_build_path("dpc_gemm") app_file = os.path.join(app_folder, "dpc_gemm") p = subprocess.Popen(["./ze_hot_functions", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./ze_hot_functions", app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if stderr: return stderr if stdout.find(" CORRECT") == -1: return stdout if stdout.find("Job is successfully completed") == -1: return stdout if not parse(stdout): return stdout return None
def run(path, option): app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./ze_intercept", option, app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stderr: return stdout if stdout.find(" CORRECT") == -1: return stdout if stderr.find("Job is successfully completed") == -1: return stderr return None
def run(path): app_folder = utils.get_sample_build_path("cl_gemm") app_file = os.path.join(app_folder, "cl_gemm") p = subprocess.Popen(["./cl_gpu_metrics", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stdout: return stderr if stdout.find(" CORRECT") == -1: return stdout if not parse(stderr): return stderr return None
def main(option): path = utils.get_sample_build_path("omp_hot_regions") log = omp_gemm.main(option) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def main(option): path = utils.get_sample_build_path("ze_intercept") log = ze_gemm.main(None) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def clean(): for sample in samples: path = utils.get_sample_build_path(sample[0]) if os.path.exists(path): shutil.rmtree(path) remove_python_cache(utils.get_build_utils_path()) remove_python_cache(utils.get_samples_utils_path()) remove_python_cache(utils.get_script_path()) for root, subdirs, files in os.walk(utils.get_root_path()): for file in files: if file.endswith(".log"): os.remove(os.path.join(root, file))
def main(option): path = utils.get_sample_build_path("ze_metric_streamer") log = ze_gemm.main(None) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path) if log: return log
def run(path, option): if option == "cl": app_folder = utils.get_sample_build_path("cl_gemm") app_file = os.path.join(app_folder, "cl_gemm") p = subprocess.Popen(["./gpu_perfmon_read", app_file, "gpu", "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) else: app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./gpu_perfmon_read", app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if stderr: return stderr if stdout.find(" CORRECT") == -1: return stdout if stdout.find("Job is successfully completed") == -1: return stdout if stdout.find("add") == -1 or stdout.find("mov") == -1 or stdout.find("send") == -1: return stdout if not parse(stdout): return stdout return None
def main(option): path = utils.get_sample_build_path("cl_gpu_metrics") log = cl_gemm.main("gpu") if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path) if log: return log
def run(path): app_folder = utils.get_sample_build_path("ze_gemm") app_file = os.path.join(app_folder, "ze_gemm") p = subprocess.Popen(["./ze_metric_streamer", app_file, "1024", "1"],\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if stderr: return stderr if stdout.find(" CORRECT") == -1: return stdout if stdout.find("Job is successfully completed") == -1: return stdout if not parse(stdout): return stdout return None
def run(path): app_folder = utils.get_sample_build_path("cl_gemm") app_file = os.path.join(app_folder, "cl_gemm") p = subprocess.Popen(["./cl_debug_info", app_file, "gpu", "1024", "1"], cwd=path, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stderr: return stdout if stdout.find(" CORRECT") == -1: return stdout if stderr.find("__kernel") == -1 or stderr.find("for") == -1: return stderr if stderr.find("add") == -1 or stderr.find("mov") == -1 or stderr.find( "send") == -1: return stderr return None
def run(path, option): app_folder = utils.get_sample_build_path("omp_gemm") app_file = os.path.join(app_folder, "omp_gemm") e = utils.add_env(None, "OMP_TOOL_LIBRARIES", "./libomp_hot_regions.so") p = subprocess.Popen([app_file, option, "1024", "1"], env = e,\ cwd = path, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = utils.run_process(p) if not stderr: return stdout if stdout.find(" CORRECT") == -1: return stdout if stderr == "gpu" and stderr.find("Target") == -1: return stderr if stderr == "cpu" and stderr.find("Parallel") == -1: return stderr if not parse(stderr): return stderr return None
def main(option): path = utils.get_sample_build_path("gpu_perfmon_read") if option == "cl": log = cl_gemm.main("gpu") if log: return log else: log = ze_gemm.main(None) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def main(option): path = utils.get_sample_build_path("ze_metric_query") if option == "dpc": log = dpc_gemm.main("gpu") if log: return log else: log = ze_gemm.main(None) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def main(option): path = utils.get_sample_build_path("ze_hot_functions") if option == "dpc": log = dpc_gemm.main("gpu") if log: return log elif option == "omp": log = omp_gemm.main("gpu") if log: return log else: log = ze_gemm.main(None) if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log
def main(option): path = utils.get_sample_build_path("gpu_inst_count") if option == "cl": log = cl_gemm.main("gpu") if log: return log elif option == "ze": log = ze_gemm.main(None) if log: return log else: log = dpc_gemm.main("gpu") if log: return log log = config(path) if log: return log log = build(path) if log: return log log = run(path, option) if log: return log