diff --git a/run_tests.py b/run_tests.py index ec756cf8..170a0b73 100755 --- a/run_tests.py +++ b/run_tests.py @@ -165,6 +165,9 @@ def run_test(testname): if (options.target == "knc"): ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \ (filename, options.arch, "generic-16") + elif (options.target == "knl"): + ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \ + (filename, options.arch, "generic-16") else: ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \ (filename, options.arch, options.target) @@ -264,6 +267,9 @@ def run_test(testname): if (options.target == "knc"): cc_cmd = "%s -O2 -I. %s %s test_static.cpp -DTEST_SIG=%d %s -o %s" % \ (options.compiler_exe, gcc_arch, "-mmic", match, obj_name, exe_name) + if (options.target == "knl"): + cc_cmd = "%s -O2 -I. %s %s test_static.cpp -DTEST_SIG=%d %s -o %s" % \ + (options.compiler_exe, gcc_arch, "-xMIC-AVX512", match, obj_name, exe_name) else: cc_cmd = "%s -O2 -I. %s %s test_static.cpp -DTEST_SIG=%d %s -o %s" % \ (options.compiler_exe, gcc_arch, gcc_isa, match, obj_name, exe_name) @@ -285,6 +291,9 @@ def run_test(testname): if (options.target == "knc"): ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \ (filename, obj_name, options.arch, "generic-16") + if (options.target == "knl"): + ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \ + (filename, obj_name, options.arch, "generic-16") else: ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \ (filename, obj_name, options.arch, options.target) @@ -546,7 +555,7 @@ def verify(): "sse4-i8x16", "avx1-i32x4" "avx1-i32x8", "avx1-i32x16", "avx1-i64x4", "avx1.1-i32x8", "avx1.1-i32x16", "avx1.1-i64x4", "avx2-i32x8", "avx2-i32x16", "avx2-i64x4", "generic-1", "generic-4", "generic-8", - "generic-16", "generic-32", "generic-64", "knc"]] + "generic-16", "generic-32", "generic-64", "knc", "knl"]] for i in range (0,len(f_lines)): if f_lines[i][0] == "%": continue @@ -622,7 +631,7 @@ def run_tests(options1, args, print_version): global is_generic_target is_generic_target = ((options.target.find("generic-") != -1 and options.target != "generic-1" and options.target != "generic-x1") or - options.target == "knc") + options.target == "knc" or options.target == "knl") global is_nvptx_target is_nvptx_target = (options.target.find("nvptx") != -1) @@ -650,10 +659,15 @@ def run_tests(options1, args, print_version): elif options.target == "knc": error("No knc #include specified; using examples/intrinsics/knc.h\n", 2) options.include_file = "examples/intrinsics/knc.h" + elif options.target == "knl": + error("No knl #include specified; using examples/intrinsics/knl.h\n", 2) + options.include_file = "examples/intrinsics/knl.h" if options.compiler_exe == None: if (options.target == "knc"): options.compiler_exe = "icpc" + elif (options.target == "knl"): + options.compiler_exe = "icpc" elif is_windows: options.compiler_exe = "cl.exe" else: @@ -699,7 +713,7 @@ def run_tests(options1, args, print_version): OS = "Linux" if not (OS == 'Linux'): - error ("knc target supported only on Linux", 1) + error ("knc target is supported only on Linux", 1) # if no specific test files are specified, run all of the tests in tests/, # failing_tests/, and tests_errors/ if len(args) == 0: @@ -890,11 +904,12 @@ if __name__ == "__main__": parser.add_option("-f", "--ispc-flags", dest="ispc_flags", help="Additional flags for ispc (-g, -O1, ...)", default="") parser.add_option('-t', '--target', dest='target', - help='Set compilation target (sse2-i32x4, sse2-i32x8, sse4-i32x4, sse4-i32x8, sse4-i16x8, sse4-i8x16, avx1-i32x8, avx1-i32x16, avx1.1-i32x8, avx1.1-i32x16, avx2-i32x8, avx2-i32x16, generic-x1, generic-x4, generic-x8, generic-x16, generic-x32, generic-x64, knc)', - default="sse4") + help=('Set compilation target (sse2-i32x4, sse2-i32x8, sse4-i32x4, sse4-i32x8, ' + + 'sse4-i16x8, sse4-i8x16, avx1-i32x8, avx1-i32x16, avx1.1-i32x8, avx1.1-i32x16, ' + + 'avx2-i32x8, avx2-i32x16, generic-x1, generic-x4, generic-x8, generic-x16, ' + + 'generic-x32, generic-x64, knc, knl)'), default="sse4") parser.add_option('-a', '--arch', dest='arch', - help='Set architecture (arm, x86, x86-64)', - default="x86-64") + help='Set architecture (arm, x86, x86-64)',default="x86-64") parser.add_option("-c", "--compiler", dest="compiler_exe", help="C/C++ compiler binary to use to run tests", default=None) parser.add_option('-o', '--no-opt', dest='no_opt', help='Disable optimization',