modified run_tests.py to support knl compilation
This commit is contained in:
29
run_tests.py
29
run_tests.py
@@ -165,6 +165,9 @@ def run_test(testname):
|
|||||||
if (options.target == "knc"):
|
if (options.target == "knc"):
|
||||||
ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \
|
ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \
|
||||||
(filename, options.arch, "generic-16")
|
(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:
|
else:
|
||||||
ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \
|
ispc_cmd = ispc_exe_rel + " --werror --nowrap %s --arch=%s --target=%s" % \
|
||||||
(filename, options.arch, options.target)
|
(filename, options.arch, options.target)
|
||||||
@@ -264,6 +267,9 @@ def run_test(testname):
|
|||||||
if (options.target == "knc"):
|
if (options.target == "knc"):
|
||||||
cc_cmd = "%s -O2 -I. %s %s test_static.cpp -DTEST_SIG=%d %s -o %s" % \
|
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)
|
(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:
|
else:
|
||||||
cc_cmd = "%s -O2 -I. %s %s test_static.cpp -DTEST_SIG=%d %s -o %s" % \
|
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)
|
(options.compiler_exe, gcc_arch, gcc_isa, match, obj_name, exe_name)
|
||||||
@@ -285,6 +291,9 @@ def run_test(testname):
|
|||||||
if (options.target == "knc"):
|
if (options.target == "knc"):
|
||||||
ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \
|
ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \
|
||||||
(filename, obj_name, options.arch, "generic-16")
|
(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:
|
else:
|
||||||
ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \
|
ispc_cmd = ispc_exe_rel + " --woff %s -o %s --arch=%s --target=%s" % \
|
||||||
(filename, obj_name, options.arch, options.target)
|
(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",
|
"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",
|
"avx1.1-i32x16", "avx1.1-i64x4", "avx2-i32x8", "avx2-i32x16", "avx2-i64x4",
|
||||||
"generic-1", "generic-4", "generic-8",
|
"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)):
|
for i in range (0,len(f_lines)):
|
||||||
if f_lines[i][0] == "%":
|
if f_lines[i][0] == "%":
|
||||||
continue
|
continue
|
||||||
@@ -622,7 +631,7 @@ def run_tests(options1, args, print_version):
|
|||||||
global is_generic_target
|
global is_generic_target
|
||||||
is_generic_target = ((options.target.find("generic-") != -1 and
|
is_generic_target = ((options.target.find("generic-") != -1 and
|
||||||
options.target != "generic-1" and options.target != "generic-x1") or
|
options.target != "generic-1" and options.target != "generic-x1") or
|
||||||
options.target == "knc")
|
options.target == "knc" or options.target == "knl")
|
||||||
|
|
||||||
global is_nvptx_target
|
global is_nvptx_target
|
||||||
is_nvptx_target = (options.target.find("nvptx") != -1)
|
is_nvptx_target = (options.target.find("nvptx") != -1)
|
||||||
@@ -650,10 +659,15 @@ def run_tests(options1, args, print_version):
|
|||||||
elif options.target == "knc":
|
elif options.target == "knc":
|
||||||
error("No knc #include specified; using examples/intrinsics/knc.h\n", 2)
|
error("No knc #include specified; using examples/intrinsics/knc.h\n", 2)
|
||||||
options.include_file = "examples/intrinsics/knc.h"
|
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.compiler_exe == None:
|
||||||
if (options.target == "knc"):
|
if (options.target == "knc"):
|
||||||
options.compiler_exe = "icpc"
|
options.compiler_exe = "icpc"
|
||||||
|
elif (options.target == "knl"):
|
||||||
|
options.compiler_exe = "icpc"
|
||||||
elif is_windows:
|
elif is_windows:
|
||||||
options.compiler_exe = "cl.exe"
|
options.compiler_exe = "cl.exe"
|
||||||
else:
|
else:
|
||||||
@@ -699,7 +713,7 @@ def run_tests(options1, args, print_version):
|
|||||||
OS = "Linux"
|
OS = "Linux"
|
||||||
|
|
||||||
if not (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/,
|
# if no specific test files are specified, run all of the tests in tests/,
|
||||||
# failing_tests/, and tests_errors/
|
# failing_tests/, and tests_errors/
|
||||||
if len(args) == 0:
|
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, ...)",
|
parser.add_option("-f", "--ispc-flags", dest="ispc_flags", help="Additional flags for ispc (-g, -O1, ...)",
|
||||||
default="")
|
default="")
|
||||||
parser.add_option('-t', '--target', dest='target',
|
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)',
|
help=('Set compilation target (sse2-i32x4, sse2-i32x8, sse4-i32x4, sse4-i32x8, ' +
|
||||||
default="sse4")
|
'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',
|
parser.add_option('-a', '--arch', dest='arch',
|
||||||
help='Set architecture (arm, x86, x86-64)',
|
help='Set architecture (arm, x86, x86-64)',default="x86-64")
|
||||||
default="x86-64")
|
|
||||||
parser.add_option("-c", "--compiler", dest="compiler_exe", help="C/C++ compiler binary to use to run tests",
|
parser.add_option("-c", "--compiler", dest="compiler_exe", help="C/C++ compiler binary to use to run tests",
|
||||||
default=None)
|
default=None)
|
||||||
parser.add_option('-o', '--no-opt', dest='no_opt', help='Disable optimization',
|
parser.add_option('-o', '--no-opt', dest='no_opt', help='Disable optimization',
|
||||||
|
|||||||
Reference in New Issue
Block a user