Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SYCL/Basic/device_code_dae.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions SYCL/Basic/fpga_tests/fpga_aocx_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions SYCL/Basic/fpga_tests/fpga_queue.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions SYCL/Basic/handler/interop_task.cpp
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion SYCL/Basic/sampler/sampler.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions SYCL/Basic/sampler/sampler_ocl.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion SYCL/Config/kernel_from_file.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions SYCL/DeviceLib/separate_compile_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion SYCL/InorderQueue/in_order_buffs_ocl.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion SYCL/InorderQueue/in_order_dmemll_ocl.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion SYCL/InorderQueue/prop.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion SYCL/KernelAndProgram/kernel-and-program-interop.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions SYCL/Regression/cache_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out

// REQUIRES: level_zero
// UNSUPPORTED: cl_options

#include <algorithm>
#include <level_zero/ze_api.h>
Expand Down
6 changes: 3 additions & 3 deletions SYCL/Regression/msvc_crt.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion SYCL/SeparateCompile/test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// UNSUPPORTED: cuda
// UNSUPPORTED: cuda,cl_options
// CUDA does not support SPIR-V.
//
// >> ---- compile src1
Expand Down
4 changes: 2 additions & 2 deletions SYCL/USM/source_kernel_indirect_access.cpp
Original file line number Diff line number Diff line change
@@ -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 <CL/cl.h>
#include <CL/sycl.hpp>
Expand Down
36 changes: 31 additions & 5 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,23 @@
# test_exec_root: The root path where tests should be run.
config.test_exec_root = config.sycl_obj_root

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',
Expand Down Expand Up @@ -77,9 +93,20 @@

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
config.available_features.add('cl_options')

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', ' '+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])
Expand Down Expand Up @@ -108,15 +135,14 @@

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

Expand Down
2 changes: 1 addition & 1 deletion cmake/caches/clang_fsycl.cmake
Original file line number Diff line number Diff line change
@@ -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 "")
2 changes: 1 addition & 1 deletion cmake/caches/clang_fsycl_cuda.cmake
Original file line number Diff line number Diff line change
@@ -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 "")