Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sycl' into private/abatashe/move…
Browse files Browse the repository at this point in the history
…_int_headers

* origin/sycl:
  [SYCL] Added CTS test config (intel#1063)
  [SYCL] Implement check-sycl-deploy target (intel#1142)
  • Loading branch information
Alexander Batashev committed Feb 19, 2020
2 parents 59325ac + febf832 commit fb4cc3f
Show file tree
Hide file tree
Showing 22 changed files with 121 additions and 22 deletions.
45 changes: 45 additions & 0 deletions buildbot/testlist.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
:test_accessor
:test_address_space
:test_atomic
:test_buffer
:test_context
:test_device
:test_device_event
:test_device_selector
:test_error
:test_event
:test_exception_handling
:test_group
:test_h_item
:test_handler
:test_header
:test_hierarchical
:test_id
:test_image
:test_invoke
:test_item
:test_kernel
:test_kernel_args
:test_math_builtin_api
:test_multi_ptr
:test_nd_item
:test_nd_range
:test_opencl_interop
:test_platform
:test_pointers
:test_program
:test_queue
:test_range
:test_sampler
:test_scalars
:test_std_classes
:test_stream
:test_vector_alias
:test_vector_api
:test_vector_constructors
:test_vector_load_store
# Disable test to speedup testing until JIT is optimized
#:test_vector_operators
:test_vector_swizzle_assignment
:test_vector_swizzles
:test_vector_swizzles_opencl
1 change: 1 addition & 0 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ set(CLANG_VERSION "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}.${CLANG_VERSION

set(LLVM_INST_INC_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include")
set(dst_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
set(dst_deploy_dir ${CMAKE_INSTALL_PREFIX}/lib/clang/${CLANG_VERSION}/include)

# Find OpenCL headers and libraries installed in the system and use them to
# build SYCL runtime.
Expand Down
28 changes: 28 additions & 0 deletions sycl/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ set(CLANG_IN_BUILD "${LLVM_BINARY_DIR}/bin/clang")
set(CLANGXX_IN_BUILD "${LLVM_BINARY_DIR}/bin/clang++")
set(CLANGCL_IN_BUILD "${LLVM_BINARY_DIR}/bin/clang-cl")

set(LLVM_DEPLOY_LIBRARY_DIRS "${CMAKE_INSTALL_PREFIX}/lib/")
set(LLVM_DEPLOY_BINARY_DIRS "${CMAKE_INSTALL_PREFIX}/bin/")
set(CLANG_IN_DEPLOY "${CMAKE_INSTALL_PREFIX}/bin/clang")
set(CLANGXX_IN_DEPLOY "${CMAKE_INSTALL_PREFIX}/bin/clang++")
set(CLANGCL_IN_DEPLOY "${CMAKE_INSTALL_PREFIX}/bin/clang-cl")

get_target_property(SYCL_BINARY_DIR sycl-toolchain BINARY_DIR)

set(SYCL_INCLUDE "${dst_dir}")
set(SYCL_DEPLOY_INCLUDE "${dst_deploy_dir}")

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

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
Expand All @@ -25,6 +33,13 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
)

configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/deploy-lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/deploy-lit.site.cfg.py
MAIN_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)

list(APPEND SYCL_TEST_DEPS
sycl-toolchain
FileCheck
Expand All @@ -33,11 +48,24 @@ list(APPEND SYCL_TEST_DEPS
llvm-config
)

list(APPEND SYCL_DEPLOY_TEST_DEPS
deploy-sycl-toolchain
FileCheck
not
get_device_count_by_type
llvm-config
)

add_lit_testsuite(check-sycl "Running the SYCL regression tests"
${CMAKE_CURRENT_BINARY_DIR}
ARGS ${RT_TEST_ARGS}
DEPENDS ${SYCL_TEST_DEPS}
)
add_lit_testsuite(check-sycl-deploy "Running the SYCL regression tests"
${CMAKE_CURRENT_BINARY_DIR}
ARGS ${DEPLOY_RT_TEST_ARGS}
DEPENDS ${SYCL_DEPLOY_TEST_DEPS}
)
set_target_properties(check-sycl PROPERTIES FOLDER "SYCL tests")

add_lit_testsuites(SYCL ${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/basic_tests/buffer/buffer_interop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// 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/test/basic_tests/buffer/subbuffer_interop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// 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/test/basic_tests/event.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
//==--------------- event.cpp - SYCL event test ----------------------------==//
//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/basic_tests/kernel_interop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// 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/test/basic_tests/sampler/sampler.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/basic_tests/set_arg_interop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL -O3
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL -O3
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
Expand Down
25 changes: 25 additions & 0 deletions sycl/test/deploy-lit.site.cfg.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@LIT_SITE_CFG_IN_HEADER@

import sys

config.clang = "@CLANG_IN_DEPLOY@"
config.clangxx = "@CLANGXX_IN_DEPLOY@"
config.clang_cl = "@CLANGCL_IN_DEPLOY@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.llvm_build_libs_dir = "@LLVM_DEPLOY_LIBRARY_DIRS@"
config.llvm_build_bins_dir = "@LLVM_DEPLOY_BINARY_DIRS@"
config.llvm_binary_dir = "@LLVM_BINARY_DIR@"
config.sycl_include = "@SYCL_DEPLOY_INCLUDE@"
config.sycl_obj_root = "@SYCL_BINARY_DIR@"
config.opencl_lib = "@OpenCL_LIBRARIES@"
config.opencl_libs_dir = os.path.dirname("@OpenCL_LIBRARIES@")

config.llvm_enable_projects = "@LLVM_ENABLE_PROJECTS@"


import lit.llvm
lit.llvm.initialize(lit_config, config)

# Let the main config do the real work.
lit_config.load_config(config, "@SYCL_SOURCE_DIR@/test/lit.cfg.py")
2 changes: 1 addition & 1 deletion sycl/test/fpga_tests/fpga_queue.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/function-pointers/fp-as-kernel-arg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/function-pointers/pass-fp-through-buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -Xclang -fsycl-allow-func-ptr -std=c++14 -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/kernel-and-program/kernel-and-program.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUNx: %GPU_RUN_PLACEHOLDER %t.out
Expand Down
10 changes: 5 additions & 5 deletions sycl/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
if 'OCL_ICD_FILENAMES' in os.environ:
config.environment['OCL_ICD_FILENAMES'] = os.environ['OCL_ICD_FILENAMES']

config.substitutions.append( ('%clang_cc1', ' ' + config.clang + ' -cc1 ') )
config.substitutions.append( ('%clangxx', ' ' + config.clangxx + ' -I'+config.opencl_include + ' -I'+config.sycl_source_dir ) )
config.substitutions.append( ('%clang_cl', ' ' + config.clang_cl + ' /I '+config.opencl_include ) )
config.substitutions.append( ('%clang', ' ' + config.clang + ' -I'+config.opencl_include ) )
config.substitutions.append( ('%clangxx', ' ' + config.clangxx ) )
config.substitutions.append( ('%clang_cl', ' ' + config.clang_cl ) )
config.substitutions.append( ('%clang', ' ' + config.clang ) )
config.substitutions.append( ('%llvm_build_libs_dir', config.llvm_build_libs_dir ) )
config.substitutions.append( ('%opencl_include', config.opencl_include ) )
config.substitutions.append( ('%sycl_include', config.sycl_include ) )
config.substitutions.append( ('%opencl_libs_dir', config.opencl_libs_dir) )
config.substitutions.append( ('%sycl_source_dir', config.sycl_source_dir) )

tools = ['llvm-spirv']
tool_dirs = [config.llvm_tools_dir]
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.llvm_build_libs_dir = "@LLVM_BUILD_LIBRARY_DIRS@"
config.llvm_build_bins_dir = "@LLVM_BUILD_BINARY_DIRS@"
config.llvm_binary_dir = "@LLVM_BINARY_DIR@"
config.opencl_include = "@OPENCL_INCLUDE@"
config.sycl_include = "@SYCL_INCLUDE@"
config.sycl_obj_root = "@SYCL_BINARY_DIR@"
config.sycl_source_dir = "@SYCL_SOURCE_DIR@/source"
config.opencl_libs_dir = os.path.dirname("@OpenCL_LIBRARIES@")

config.llvm_enable_projects = "@LLVM_ENABLE_PROJECTS@"

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/ordered_queue/ordered_buffs.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// 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/test/ordered_queue/ordered_dmemll.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t1.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t1.out -L %opencl_libs_dir -lOpenCL
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
// RUN: %GPU_RUN_PLACEHOLDER %t1.out

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/ordered_queue/ordered_queue.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
//==---------- ordered_queue.cpp - SYCL ordered queue test -----------------==//
//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/ordered_queue/prop.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl %s -o %t1.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t1.out -L %opencl_libs_dir -lOpenCL
// RUN: %CPU_RUN_PLACEHOLDER %t1.out
// RUN: %GPU_RUN_PLACEHOLDER %t1.out

Expand Down
2 changes: 1 addition & 1 deletion sycl/test/sub_group/common_ocl.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -x cl -cl-std=CL2.0 %S/sg.cl -triple spir64-unknown-unknown -emit-llvm-bc -o %T/kernel_ocl.bc -include opencl-c.h
// RUN: llvm-spirv %T/kernel_ocl.bc -o %T/kernel_ocl.spv
// RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out %T/kernel_ocl.spv
// RUN: %GPU_RUN_PLACEHOLDER %t.out %T/kernel_ocl.spv
Expand Down
2 changes: 1 addition & 1 deletion sycl/test/usm/prefetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// RUN: %clangxx -fsycl %s -o %t1.out -lOpenCL
// RUN: %clangxx -fsycl %s -o %t1.out -L %opencl_libs_dir -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t1.out
// RUN: %CPU_RUN_PLACEHOLDER %t1.out

Expand Down

0 comments on commit fb4cc3f

Please sign in to comment.