From 0245750f175de46a7691972546776ed65267ac11 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Mon, 7 Dec 2020 17:49:38 +0300 Subject: [PATCH 01/10] [SYCL] Make LIT use compiler provided by user %clangxx and %clang were always set to clang which is not expected. After the fix the substitutions above are set to the compiler passed by user. --- SYCL/lit.cfg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 3dc0a3911d..d956b28a58 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -34,6 +34,9 @@ # test_exec_root: The root path where tests should be run. config.test_exec_root = config.sycl_obj_root +config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) +config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) + llvm_config.use_clang() # Propagate some variables from the host environment. @@ -112,8 +115,6 @@ ' ' + '-fsycl-explicit-simd' + ' ' + config.cxx_flags ) ) -config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) -config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) config.substitutions.append( ('%threads_lib', config.sycl_threads_lib) ) From 86ee33c0b12e8751e6ee6bb36ba722cf8f2ed084 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Mon, 7 Dec 2020 18:29:45 +0300 Subject: [PATCH 02/10] Fix regression --- SYCL/lit.cfg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index d956b28a58..a232b4235b 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -34,6 +34,9 @@ # test_exec_root: The root path where tests should be run. config.test_exec_root = config.sycl_obj_root +config.substitutions.append( ('%clangxx-esimd', config.dpcpp_compiler + + ' ' + '-fsycl-explicit-simd' + ' ' + + config.cxx_flags ) ) config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) @@ -111,9 +114,6 @@ esimd_run_substitute = "env SYCL_BE={SYCL_BE} SYCL_DEVICE_TYPE=GPU SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen".format(SYCL_BE=config.sycl_be) config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) ) -config.substitutions.append( ('%clangxx-esimd', config.dpcpp_compiler + - ' ' + '-fsycl-explicit-simd' + ' ' + - config.cxx_flags ) ) config.substitutions.append( ('%threads_lib', config.sycl_threads_lib) ) From a7c67e655157a28c42c7fc05253b171eb916bf93 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Mon, 7 Dec 2020 19:17:28 +0300 Subject: [PATCH 03/10] Fix regression --- SYCL/lit.cfg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index a232b4235b..bb7781860c 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -115,6 +115,8 @@ esimd_run_substitute = "env SYCL_BE={SYCL_BE} SYCL_DEVICE_TYPE=GPU SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen".format(SYCL_BE=config.sycl_be) config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) ) +config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) +config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) config.substitutions.append( ('%threads_lib', config.sycl_threads_lib) ) From a787faf0690344cc26cd7f4c47cf85f86c6ac671 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Mon, 7 Dec 2020 20:12:05 +0300 Subject: [PATCH 04/10] revert change --- SYCL/lit.cfg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index bb7781860c..b53f367a7a 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -37,8 +37,8 @@ config.substitutions.append( ('%clangxx-esimd', config.dpcpp_compiler + ' ' + '-fsycl-explicit-simd' + ' ' + config.cxx_flags ) ) -config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) -config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) +#config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) +#config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) llvm_config.use_clang() From 3efe14a2e7d1f9ee291593b7b4470856d30409cc Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Tue, 8 Dec 2020 11:07:45 +0300 Subject: [PATCH 05/10] Reapply fix --- SYCL/lit.cfg.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index b53f367a7a..3864530848 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -37,9 +37,7 @@ config.substitutions.append( ('%clangxx-esimd', config.dpcpp_compiler + ' ' + '-fsycl-explicit-simd' + ' ' + config.cxx_flags ) ) -#config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) -#config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) - +llvm_config.with_environment('CLANG', config.dpcpp_compiler) llvm_config.use_clang() # Propagate some variables from the host environment. @@ -115,8 +113,6 @@ esimd_run_substitute = "env SYCL_BE={SYCL_BE} SYCL_DEVICE_TYPE=GPU SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen".format(SYCL_BE=config.sycl_be) config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) ) -config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) -config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) config.substitutions.append( ('%threads_lib', config.sycl_threads_lib) ) From 74873d48325012aea2986d1267c2c2eb4273968f Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Thu, 10 Dec 2020 13:13:58 +0300 Subject: [PATCH 06/10] Remove use of llvm_config.use_clang() --- SYCL/lit.cfg.py | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 3864530848..01900ed495 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -34,11 +34,23 @@ # test_exec_root: The root path where tests should be run. config.test_exec_root = config.sycl_obj_root -config.substitutions.append( ('%clangxx-esimd', config.dpcpp_compiler + - ' ' + '-fsycl-explicit-simd' + ' ' + - config.cxx_flags ) ) -llvm_config.with_environment('CLANG', config.dpcpp_compiler) -llvm_config.use_clang() +# Cleanup environment variables which may affect tests +possibly_dangerous_env_vars = ['COMPILER_PATH', 'RC_DEBUG_OPTIONS', + 'CINDEXTEST_PREAMBLE_FILE', 'LIBRARY_PATH', + 'CPATH', 'C_INCLUDE_PATH', 'CPLUS_INCLUDE_PATH', + 'OBJC_INCLUDE_PATH', 'OBJCPLUS_INCLUDE_PATH', + 'LIBCLANG_TIMING', 'LIBCLANG_OBJTRACKING', + 'LIBCLANG_LOGGING', 'LIBCLANG_BGPRIO_INDEX', + 'LIBCLANG_BGPRIO_EDIT', 'LIBCLANG_NOTHREADS', + 'LIBCLANG_RESOURCE_USAGE', + 'LIBCLANG_CODE_COMPLETION_LOGGING'] +# Clang/Win32 may refer to %INCLUDE%. vsvarsall.bat sets it. +if platform.system() != 'Windows': + possibly_dangerous_env_vars.append('INCLUDE') + +for name in possibly_dangerous_env_vars: + if name in llvm_config.config.environment: + del llvm_config.config.environment[name] # Propagate some variables from the host environment. llvm_config.with_system_environment(['PATH', 'OCL_ICD_FILENAMES', @@ -113,9 +125,13 @@ esimd_run_substitute = "env SYCL_BE={SYCL_BE} SYCL_DEVICE_TYPE=GPU SYCL_PROGRAM_COMPILE_OPTIONS=-vc-codegen".format(SYCL_BE=config.sycl_be) config.substitutions.append( ('%ESIMD_RUN_PLACEHOLDER', esimd_run_substitute) ) +config.substitutions.append( ('%clangxx-esimd', config.dpcpp_compiler + + ' ' + '-fsycl-explicit-simd' + ' ' + + config.cxx_flags ) ) +config.substitutions.append( ('%clangxx', ' '+ config.dpcpp_compiler + ' ' + config.cxx_flags ) ) +config.substitutions.append( ('%clang', ' ' + config.dpcpp_compiler + ' ' + config.c_flags ) ) config.substitutions.append( ('%threads_lib', config.sycl_threads_lib) ) - # Configure device-specific substitutions based on availability of corresponding # devices/runtimes From 17e01848a92ae92cdef8caa501e341c2f1a13032 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Thu, 10 Dec 2020 15:09:06 +0300 Subject: [PATCH 07/10] Fix build of tests requiring OpenCL ICD loader --- SYCL/Basic/fpga_tests/fpga_queue.cpp | 4 ++-- SYCL/Basic/handler/interop_task.cpp | 4 ++-- SYCL/Basic/sampler/sampler.cpp | 3 ++- SYCL/Basic/sampler/sampler_ocl.cpp | 4 ++-- SYCL/InorderQueue/in_order_buffs_ocl.cpp | 2 +- SYCL/InorderQueue/in_order_dmemll_ocl.cpp | 2 +- SYCL/InorderQueue/prop.cpp | 2 +- .../kernel-and-program-interop.cpp | 2 +- SYCL/USM/source_kernel_indirect_access.cpp | 4 ++-- SYCL/lit.cfg.py | 14 ++++++++++++-- 10 files changed, 26 insertions(+), 15 deletions(-) diff --git a/SYCL/Basic/fpga_tests/fpga_queue.cpp b/SYCL/Basic/fpga_tests/fpga_queue.cpp index a1e1f34917..bf82e1f625 100644 --- a/SYCL/Basic/fpga_tests/fpga_queue.cpp +++ b/SYCL/Basic/fpga_tests/fpga_queue.cpp @@ -1,6 +1,6 @@ -// REQUIRES: opencl +// REQUIRES: opencl, opencl_icd -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %opencl_lib // RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Basic/handler/interop_task.cpp b/SYCL/Basic/handler/interop_task.cpp index 4e12b996d1..f4a46fd86c 100644 --- a/SYCL/Basic/handler/interop_task.cpp +++ b/SYCL/Basic/handler/interop_task.cpp @@ -1,5 +1,5 @@ -// REQUIRES: opencl -// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL +// REQUIRES: opencl, opencl_icd +// RUN: %clangxx -fsycl %s -o %t.out %opencl_lib // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Basic/sampler/sampler.cpp b/SYCL/Basic/sampler/sampler.cpp index e7948042f8..4b2f7f01b5 100644 --- a/SYCL/Basic/sampler/sampler.cpp +++ b/SYCL/Basic/sampler/sampler.cpp @@ -1,4 +1,5 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization %s -o %t.out -L %opencl_libs_dir -lOpenCL +// REQUIRES: opencl, opencl_icd +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -fsycl-dead-args-optimization %s -o %t.out %opencl_lib // RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/Basic/sampler/sampler_ocl.cpp b/SYCL/Basic/sampler/sampler_ocl.cpp index 5d6a0c9185..a00ea467ea 100644 --- a/SYCL/Basic/sampler/sampler_ocl.cpp +++ b/SYCL/Basic/sampler/sampler_ocl.cpp @@ -1,6 +1,6 @@ -// REQUIRES: opencl +// REQUIRES: opencl, opencl_icd -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %opencl_lib // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out diff --git a/SYCL/InorderQueue/in_order_buffs_ocl.cpp b/SYCL/InorderQueue/in_order_buffs_ocl.cpp index c5d1f07dd0..9c62f3a2b8 100644 --- a/SYCL/InorderQueue/in_order_buffs_ocl.cpp +++ b/SYCL/InorderQueue/in_order_buffs_ocl.cpp @@ -1,5 +1,5 @@ // REQUIRES: opencl_icd,opencl -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %opencl_lib // RUN: %ACC_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/InorderQueue/in_order_dmemll_ocl.cpp b/SYCL/InorderQueue/in_order_dmemll_ocl.cpp index d7b1d44996..94e8ea4679 100644 --- a/SYCL/InorderQueue/in_order_dmemll_ocl.cpp +++ b/SYCL/InorderQueue/in_order_dmemll_ocl.cpp @@ -1,5 +1,5 @@ // REQUIRES: opencl_icd,opencl -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out -L %opencl_libs_dir -lOpenCL +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out %opencl_lib // RUN: %CPU_RUN_PLACEHOLDER %t1.out // RUN: %ACC_RUN_PLACEHOLDER %t1.out // RUN: %GPU_RUN_PLACEHOLDER %t1.out diff --git a/SYCL/InorderQueue/prop.cpp b/SYCL/InorderQueue/prop.cpp index 97095f3bf2..8d687d406a 100644 --- a/SYCL/InorderQueue/prop.cpp +++ b/SYCL/InorderQueue/prop.cpp @@ -1,5 +1,5 @@ // REQUIRES: opencl_icd,opencl -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out -L %opencl_libs_dir -lOpenCL +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t1.out %opencl_lib // RUN: %CPU_RUN_PLACEHOLDER %t1.out // RUN: %ACC_RUN_PLACEHOLDER %t1.out // RUN: %GPU_RUN_PLACEHOLDER %t1.out diff --git a/SYCL/KernelAndProgram/kernel-and-program-interop.cpp b/SYCL/KernelAndProgram/kernel-and-program-interop.cpp index d722a33207..a6010928b9 100644 --- a/SYCL/KernelAndProgram/kernel-and-program-interop.cpp +++ b/SYCL/KernelAndProgram/kernel-and-program-interop.cpp @@ -1,6 +1,6 @@ // REQUIRES: opencl, opencl_icd -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -L %opencl_libs_dir -lOpenCL +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %opencl_lib // RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out diff --git a/SYCL/USM/source_kernel_indirect_access.cpp b/SYCL/USM/source_kernel_indirect_access.cpp index 3b22339df1..32d06204c2 100644 --- a/SYCL/USM/source_kernel_indirect_access.cpp +++ b/SYCL/USM/source_kernel_indirect_access.cpp @@ -1,8 +1,8 @@ -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -lOpenCL %s -o %t1.out +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %opencl_lib %s -o %t1.out // RUN: %CPU_RUN_PLACEHOLDER %t1.out // RUN: %GPU_RUN_PLACEHOLDER %t1.out // RUN: %ACC_RUN_PLACEHOLDER %t1.out -// REQUIRES: opencl +// REQUIRES: opencl,opencl_icd #include #include diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 01900ed495..6277e8db5f 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -93,9 +93,19 @@ config.substitutions.append( ('%sycl_libs_dir', config.sycl_libs_dir ) ) config.substitutions.append( ('%sycl_include', config.sycl_include ) ) + +# check if compiler supports CL command line options +cl_options=False +sp = subprocess.getstatusoutput(config.dpcpp_compiler+' /help') +if sp[0] == 0: + cl_options=True + if config.opencl_libs_dir: - config.substitutions.append( ('%opencl_libs_dir', config.opencl_libs_dir) ) - config.available_features.add('opencl_icd') + if cl_options: + config.substitutions.append( ('%opencl_lib', '/LIBPATH:'+config.opencl_libs_dir+' OpenCL.lib') ) + else: + config.substitutions.append( ('%opencl_lib', '-L'+config.opencl_libs_dir+' -lOpenCL') ) + config.available_features.add('opencl_icd') config.substitutions.append( ('%opencl_include_dir', config.opencl_include_dir) ) llvm_config.add_tool_substitutions(['llvm-spirv'], [config.sycl_tools_dir]) From 0e052c409d9aaad64cad0bbdfe71ce1b8e94ea2f Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Thu, 10 Dec 2020 16:03:41 +0300 Subject: [PATCH 08/10] Fix windows specific test --- SYCL/Basic/fpga_tests/fpga_aocx_win.cpp | 10 +++++----- SYCL/Regression/msvc_crt.cpp | 6 +++--- SYCL/lit.cfg.py | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp b/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp index a0113ccf78..5fee447eb6 100644 --- a/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp +++ b/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp @@ -7,20 +7,20 @@ //===----------------------------------------------------------------------===// // REQUIRES: aoc, accelerator -// REQUIRES: system-windows +// REQUIRES: system-windows, cl_options /// E2E test for AOCX creation/use/run for FPGA // Produce an archive with device (AOCX) image. To avoid appending objects to // leftover archives, remove one if exists. // RUN: rm %t_image.a || true -// RUN: %clang_cl -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib +// RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object -// RUN: %clang_cl -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj +// RUN: %clangxx -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj // AOCX with source -// RUN: %clang_cl -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp %t_image.lib -o %t_aocx_src.out +// RUN: %clangxx -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp %t_image.lib -o %t_aocx_src.out // AOCX with object -// RUN: %clang_cl -fsycl -fintelfpga %t.obj %t_image.lib -o %t_aocx_obj.out +// RUN: %clangxx -fsycl -fintelfpga %t.obj %t_image.lib -o %t_aocx_obj.out // // RUN: env SYCL_DEVICE_TYPE=ACC %t_aocx_src.out // RUN: env SYCL_DEVICE_TYPE=ACC %t_aocx_obj.out diff --git a/SYCL/Regression/msvc_crt.cpp b/SYCL/Regression/msvc_crt.cpp index b877ca58a5..5dca26ad9f 100644 --- a/SYCL/Regression/msvc_crt.cpp +++ b/SYCL/Regression/msvc_crt.cpp @@ -1,14 +1,14 @@ -// RUN: %clang_cl -fsycl /MD -o %t1.exe %s +// RUN: %clangxx -fsycl /MD -o %t1.exe %s // RUN: %HOST_RUN_PLACEHOLDER %t1.exe // RUN: %CPU_RUN_PLACEHOLDER %t1.exe // RUN: %GPU_RUN_PLACEHOLDER %t1.exe // RUN: %ACC_RUN_PLACEHOLDER %t1.exe -// RUN: %clang_cl -fsycl /MDd -o %t2.exe %s +// RUN: %clangxx -fsycl /MDd -o %t2.exe %s // RUN: %HOST_RUN_PLACEHOLDER %t2.exe // RUN: %CPU_RUN_PLACEHOLDER %t2.exe // RUN: %GPU_RUN_PLACEHOLDER %t2.exe // RUN: %ACC_RUN_PLACEHOLDER %t2.exe -// REQUIRES: system-windows +// REQUIRES: system-windows, cl_options //==-------------- msvc_crt.cpp - SYCL MSVC CRT test -----------------------==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 6277e8db5f..b12d997d34 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -99,10 +99,11 @@ sp = subprocess.getstatusoutput(config.dpcpp_compiler+' /help') if sp[0] == 0: cl_options=True + config.available_features.add('cl_options') if config.opencl_libs_dir: if cl_options: - config.substitutions.append( ('%opencl_lib', '/LIBPATH:'+config.opencl_libs_dir+' OpenCL.lib') ) + config.substitutions.append( ('%opencl_lib', ' '+config.opencl_libs_dir+'/OpenCL.lib') ) else: config.substitutions.append( ('%opencl_lib', '-L'+config.opencl_libs_dir+' -lOpenCL') ) config.available_features.add('opencl_icd') From c5fc3140f8b1d0a37e1640e2f7939f446c4ce0da Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Thu, 10 Dec 2020 22:04:28 +0300 Subject: [PATCH 09/10] Disable unsupported tests --- SYCL/Basic/device_code_dae.cpp | 2 +- SYCL/Config/kernel_from_file.cpp | 2 +- SYCL/DeviceLib/separate_compile_test.cpp | 1 + SYCL/SeparateCompile/test.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SYCL/Basic/device_code_dae.cpp b/SYCL/Basic/device_code_dae.cpp index 52eb03d9bb..b88d670b14 100644 --- a/SYCL/Basic/device_code_dae.cpp +++ b/SYCL/Basic/device_code_dae.cpp @@ -1,6 +1,6 @@ // NOTE A temporary test before this compilation flow is enabled by default in // driver -// UNSUPPORTED: cuda +// UNSUPPORTED: cuda,cl_options // CUDA does not support SPIR-V. // RUN: %clangxx -fsycl-device-only -Xclang -fenable-sycl-dae -Xclang -fsycl-int-header=int_header.h %s -c -o device_code.bc -I %sycl_include -Wno-sycl-strict // RUN: %clangxx -include int_header.h -g -c %s -o host_code.o -I %sycl_include -Wno-sycl-strict diff --git a/SYCL/Config/kernel_from_file.cpp b/SYCL/Config/kernel_from_file.cpp index 83b12e5c23..46ece0ee88 100644 --- a/SYCL/Config/kernel_from_file.cpp +++ b/SYCL/Config/kernel_from_file.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: cuda +// UNSUPPORTED: cuda,cl_options // CUDA does not support SPIR-V. // RUN: %clangxx -fsycl-device-only -fno-sycl-use-bitcode -Xclang -fsycl-int-header=%t.h -c %s -o %t.spv -I %sycl_include -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict diff --git a/SYCL/DeviceLib/separate_compile_test.cpp b/SYCL/DeviceLib/separate_compile_test.cpp index 1aabbd94e8..7d41de5e40 100644 --- a/SYCL/DeviceLib/separate_compile_test.cpp +++ b/SYCL/DeviceLib/separate_compile_test.cpp @@ -13,3 +13,4 @@ // RUN: %clangxx %t_fp64_host.o %t_fp64_device.o -o %t_fp64.out -lsycl // RUN: %CPU_RUN_PLACEHOLDER %t_fp64.out // RUN: %ACC_RUN_PLACEHOLDER %t_fp64.out +// UNSUPPORTED: cl_options diff --git a/SYCL/SeparateCompile/test.cpp b/SYCL/SeparateCompile/test.cpp index 076de5fc0e..358337546a 100644 --- a/SYCL/SeparateCompile/test.cpp +++ b/SYCL/SeparateCompile/test.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: cuda +// UNSUPPORTED: cuda,cl_options // CUDA does not support SPIR-V. // // >> ---- compile src1 From 5b0b2bde4f91bc37ec4a7438c63ff4b852f3b8b6 Mon Sep 17 00:00:00 2001 From: Vladimir Lazarev Date: Fri, 11 Dec 2020 00:08:00 +0300 Subject: [PATCH 10/10] Fix failing tests --- SYCL/Regression/cache_test.cpp | 1 + cmake/caches/clang_fsycl.cmake | 2 +- cmake/caches/clang_fsycl_cuda.cmake | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SYCL/Regression/cache_test.cpp b/SYCL/Regression/cache_test.cpp index e68ec5ee24..ef2ec73bd3 100644 --- a/SYCL/Regression/cache_test.cpp +++ b/SYCL/Regression/cache_test.cpp @@ -2,6 +2,7 @@ // RUN: %GPU_RUN_PLACEHOLDER %t.out // REQUIRES: level_zero +// UNSUPPORTED: cl_options #include #include diff --git a/cmake/caches/clang_fsycl.cmake b/cmake/caches/clang_fsycl.cmake index b35fcf023d..72e366bf8f 100644 --- a/cmake/caches/clang_fsycl.cmake +++ b/cmake/caches/clang_fsycl.cmake @@ -1,4 +1,4 @@ # Default open source clang configuration with SYCL support. set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") -set(CMAKE_CXX_FLAGS "-fsycl" CACHE STRING "") +set(CMAKE_CXX_FLAGS "" CACHE STRING "") diff --git a/cmake/caches/clang_fsycl_cuda.cmake b/cmake/caches/clang_fsycl_cuda.cmake index 549f426ab0..ff324abbed 100644 --- a/cmake/caches/clang_fsycl_cuda.cmake +++ b/cmake/caches/clang_fsycl_cuda.cmake @@ -1,4 +1,4 @@ # Default open source clang configuration with SYCL support. set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") -set(CMAKE_CXX_FLAGS "-fsycl -fsycl-targets=nvptx64-nvidia-cuda-sycldevice -Xsycl-target-backend --cuda-gpu-arch=sm_32" CACHE STRING "") +set(CMAKE_CXX_FLAGS "-fsycl-targets=nvptx64-nvidia-cuda-sycldevice -Xsycl-target-backend --cuda-gpu-arch=sm_32" CACHE STRING "")