Skip to content

Commit 8a45134

Browse files
authored
[SYCL] Implement check-sycl-deploy target (#1142)
This target allows to run SYCL LIT tests with deploy bits Signed-off-by: Mariya Podchishchaeva <mariya.podchishchaeva@intel.com>
1 parent 9a34a11 commit 8a45134

21 files changed

+75
-21
lines changed

sycl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ set(CLANG_VERSION "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}.${CLANG_VERSION
5252

5353
set(LLVM_INST_INC_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include")
5454
set(dst_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
55+
set(dst_deploy_dir ${CMAKE_INSTALL_PREFIX}/lib/clang/${CLANG_VERSION}/include)
5556

5657
# Find OpenCL headers and libraries installed in the system and use them to
5758
# build SYCL runtime.

sycl/test/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ set(CLANG_IN_BUILD "${LLVM_BINARY_DIR}/bin/clang")
55
set(CLANGXX_IN_BUILD "${LLVM_BINARY_DIR}/bin/clang++")
66
set(CLANGCL_IN_BUILD "${LLVM_BINARY_DIR}/bin/clang-cl")
77

8+
set(LLVM_DEPLOY_LIBRARY_DIRS "${CMAKE_INSTALL_PREFIX}/lib/")
9+
set(LLVM_DEPLOY_BINARY_DIRS "${CMAKE_INSTALL_PREFIX}/bin/")
10+
set(CLANG_IN_DEPLOY "${CMAKE_INSTALL_PREFIX}/bin/clang")
11+
set(CLANGXX_IN_DEPLOY "${CMAKE_INSTALL_PREFIX}/bin/clang++")
12+
set(CLANGCL_IN_DEPLOY "${CMAKE_INSTALL_PREFIX}/bin/clang-cl")
13+
814
get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR)
915
get_target_property(SYCL_SOURCE_DIR sycl-toolchain SOURCE_DIR)
1016

1117
set(SYCL_INCLUDE "${dst_dir}")
18+
set(SYCL_DEPLOY_INCLUDE "${dst_deploy_dir}")
1219

1320
set(RT_TEST_ARGS ${RT_TEST_ARGS} "-v")
21+
set(DEPLOY_RT_TEST_ARGS ${DEPLOY_RT_TEST_ARGS} "-v --config-prefix=deploy-lit")
1422

1523
configure_lit_site_cfg(
1624
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
@@ -26,6 +34,13 @@ configure_lit_site_cfg(
2634
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
2735
)
2836

37+
configure_lit_site_cfg(
38+
${CMAKE_CURRENT_SOURCE_DIR}/deploy-lit.site.cfg.py.in
39+
${CMAKE_CURRENT_BINARY_DIR}/deploy-lit.site.cfg.py
40+
MAIN_CONFIG
41+
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
42+
)
43+
2944
list(APPEND SYCL_TEST_DEPS
3045
sycl-toolchain
3146
FileCheck
@@ -34,11 +49,24 @@ list(APPEND SYCL_TEST_DEPS
3449
llvm-config
3550
)
3651

52+
list(APPEND SYCL_DEPLOY_TEST_DEPS
53+
deploy-sycl-toolchain
54+
FileCheck
55+
not
56+
get_device_count_by_type
57+
llvm-config
58+
)
59+
3760
add_lit_testsuite(check-sycl "Running the SYCL regression tests"
3861
${CMAKE_CURRENT_BINARY_DIR}
3962
ARGS ${RT_TEST_ARGS}
4063
DEPENDS ${SYCL_TEST_DEPS}
4164
)
65+
add_lit_testsuite(check-sycl-deploy "Running the SYCL regression tests"
66+
${CMAKE_CURRENT_BINARY_DIR}
67+
ARGS ${DEPLOY_RT_TEST_ARGS}
68+
DEPENDS ${SYCL_DEPLOY_TEST_DEPS}
69+
)
4270
set_target_properties(check-sycl PROPERTIES FOLDER "SYCL tests")
4371

4472
add_lit_testsuites(SYCL ${CMAKE_CURRENT_SOURCE_DIR}

sycl/test/basic_tests/buffer/buffer_interop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
22
// RUN: %CPU_RUN_PLACEHOLDER %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out

sycl/test/basic_tests/buffer/subbuffer_interop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
22
// RUN: %CPU_RUN_PLACEHOLDER %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out

sycl/test/basic_tests/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
22
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
33
//==--------------- event.cpp - SYCL event test ----------------------------==//
44
//

sycl/test/basic_tests/kernel_interop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
22
// RUN: %CPU_RUN_PLACEHOLDER %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out

sycl/test/basic_tests/sampler/sampler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
22
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
33
// RUN: %CPU_RUN_PLACEHOLDER %t.out
44
// RUN: %GPU_RUN_PLACEHOLDER %t.out

sycl/test/basic_tests/set_arg_interop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL -O3
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL -O3
22
// RUN: %CPU_RUN_PLACEHOLDER %t.out
33
// RUN: %GPU_RUN_PLACEHOLDER %t.out
44
// RUN: %ACC_RUN_PLACEHOLDER %t.out
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@LIT_SITE_CFG_IN_HEADER@
2+
3+
import sys
4+
5+
config.clang = "@CLANG_IN_DEPLOY@"
6+
config.clangxx = "@CLANGXX_IN_DEPLOY@"
7+
config.clang_cl = "@CLANGCL_IN_DEPLOY@"
8+
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
9+
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
10+
config.llvm_build_libs_dir = "@LLVM_DEPLOY_LIBRARY_DIRS@"
11+
config.llvm_build_bins_dir = "@LLVM_DEPLOY_BINARY_DIRS@"
12+
config.llvm_binary_dir = "@LLVM_BINARY_DIR@"
13+
config.sycl_include = "@SYCL_DEPLOY_INCLUDE@"
14+
config.sycl_obj_root = "@SYCL_BINARY_DIR@"
15+
config.opencl_lib = "@OpenCL_LIBRARIES@"
16+
config.opencl_libs_dir = os.path.dirname("@OpenCL_LIBRARIES@")
17+
18+
config.llvm_enable_projects = "@LLVM_ENABLE_PROJECTS@"
19+
20+
21+
import lit.llvm
22+
lit.llvm.initialize(lit_config, config)
23+
24+
# Let the main config do the real work.
25+
lit_config.load_config(config, "@SYCL_SOURCE_DIR@/test/lit.cfg.py")

sycl/test/fpga_tests/fpga_queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
1+
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
22
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
33
// RUN: %ACC_RUN_PLACEHOLDER %t.out
44
// RUN: %CPU_RUN_PLACEHOLDER %t.out

0 commit comments

Comments
 (0)