Merge branch 'knl-support' of https://github.com/ncos/ispc into ncos-knl
This commit is contained in:
10
alloy.py
10
alloy.py
@@ -293,8 +293,10 @@ def check_targets():
|
||||
AVX = ["avx1-i32x4", "avx1-i32x8", "avx1-i32x16", "avx1-i64x4"]
|
||||
AVX11 = ["avx1.1-i32x8","avx1.1-i32x16","avx1.1-i64x4"]
|
||||
AVX2 = ["avx2-i32x8", "avx2-i32x16", "avx2-i64x4"]
|
||||
KNL = ["knl"]
|
||||
|
||||
targets = [["AVX2", AVX2, False], ["AVX1.1", AVX11, False], ["AVX", AVX, False], ["SSE4", SSE4, False], ["SSE2", SSE2, False]]
|
||||
targets = [["AVX2", AVX2, False], ["AVX1.1", AVX11, False], ["AVX", AVX, False], ["SSE4", SSE4, False],
|
||||
["SSE2", SSE2, False], ["KNL", KNL, False]]
|
||||
f_lines = take_lines("check_isa.exe", "first")
|
||||
for i in range(0,5):
|
||||
if targets[i][0] in f_lines:
|
||||
@@ -329,6 +331,8 @@ def check_targets():
|
||||
# here we have SDE
|
||||
f_lines = take_lines(sde_exists + " -help", "all")
|
||||
for i in range(0,len(f_lines)):
|
||||
if targets[5][2] == False and "knl" in f_lines[i]:
|
||||
answer_sde = answer_sde + [["-knl", "knl"]]
|
||||
if targets[3][2] == False and "wsm" in f_lines[i]:
|
||||
answer_sde = answer_sde + [["-wsm", "sse4-i32x4"], ["-wsm", "sse4-i32x8"], ["-wsm", "sse4-i16x8"], ["-wsm", "sse4-i8x16"]]
|
||||
if targets[2][2] == False and "snb" in f_lines[i]:
|
||||
@@ -872,8 +876,8 @@ if __name__ == '__main__':
|
||||
"Try to build compiler with all LLVM\n\talloy.py -r --only=build\n" +
|
||||
"Performance validation run with 10 runs of each test and comparing to branch 'old'\n\talloy.py -r --only=performance --compare-with=old --number=10\n" +
|
||||
"Validation run. Update fail_db.txt with new fails, send results to my@my.com\n\talloy.py -r --update-errors=F --notify='my@my.com'\n" +
|
||||
"Test KNC target (not tested when tested all supported targets, so should be set explicitly via --only-targets)\n\talloy.py -r --only='stability' --only-targets='knc'\n")
|
||||
|
||||
"Test KNC target (not tested when tested all supported targets, so should be set explicitly via --only-targets)\n\talloy.py -r --only='stability' --only-targets='knc'\n" +
|
||||
"Test KNL target (requires sde)\n\talloy.py -r --only='stability' --only-targets='knl'\n")
|
||||
|
||||
num_threads="%s" % multiprocessing.cpu_count()
|
||||
parser = MyParser(usage="Usage: alloy.py -r/-b [options]", epilog=examples)
|
||||
|
||||
3911
examples/intrinsics/knl.h
Normal file
3911
examples/intrinsics/knl.h
Normal file
File diff suppressed because it is too large
Load Diff
29
run_tests.py
29
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',
|
||||
|
||||
Reference in New Issue
Block a user