Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Enable check-sycl-unittests in CI #12858

Merged
merged 25 commits into from
Mar 21, 2024
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
6 changes: 6 additions & 0 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ jobs:
# TODO consider moving this to Dockerfile.
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
cmake --build $GITHUB_WORKSPACE/build --target check-sycl
- name: check-sycl-unittests
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
run: |
# TODO consider moving this to Dockerfile.
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
cmake --build $GITHUB_WORKSPACE/build --target check-sycl-unittests
- name: check-llvm-spirv
if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv')
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sycl-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ jobs:
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
run: |
cmake --build build --target check-sycl
- name: check-sycl-unittests
if: always() && !cancelled() && contains(inputs.changes, 'sycl')
run: |
cmake --build build --target check-sycl-unittests
- name: check-llvm-spirv
if: always() && !cancelled() && contains(inputs.changes, 'llvm_spirv')
run: |
Expand Down
40 changes: 29 additions & 11 deletions sycl/cmake/modules/AddSYCLUnitTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,34 @@ macro(add_sycl_unittest test_dirname link_variant)
)
endif()

add_custom_target(check-sycl-${test_dirname}
${CMAKE_COMMAND} -E env
LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw"
env SYCL_CONFIG_FILE_NAME=null.cfg
env SYCL_DEVICELIB_NO_FALLBACK=1
env SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache"
${CMAKE_CURRENT_BINARY_DIR}/${test_dirname}
DEPENDS
${test_dirname}
)
# check-sycl-unittests was using an old sycl library. So, to get
# around this problem, we add the new sycl library to the PATH and
# LD_LIBRARY_PATH on Windows and Linux respectively.
if (WIN32)
add_custom_target(check-sycl-${test_dirname}
${CMAKE_COMMAND} -E env
LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw"
SYCL_CONFIG_FILE_NAME=null.cfg
SYCL_DEVICELIB_NO_FALLBACK=1
SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache"
"PATH=${CMAKE_BINARY_DIR}/bin;$ENV{PATH}"
${CMAKE_CURRENT_BINARY_DIR}/${test_dirname}
DEPENDS
${test_dirname}
)
else()
add_custom_target(check-sycl-${test_dirname}
${CMAKE_COMMAND} -E env
LLVM_PROFILE_FILE="${SYCL_COVERAGE_PATH}/${test_dirname}.profraw"
SYCL_CONFIG_FILE_NAME=null.cfg
SYCL_DEVICELIB_NO_FALLBACK=1
SYCL_CACHE_DIR="${CMAKE_BINARY_DIR}/sycl_cache"
"LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}"
${CMAKE_CURRENT_BINARY_DIR}/${test_dirname}
DEPENDS
${test_dirname}
)
endif()

add_dependencies(check-sycl-unittests check-sycl-${test_dirname})

Expand All @@ -60,7 +78,7 @@ macro(add_sycl_unittest test_dirname link_variant)
if(SYCL_ENABLE_KERNEL_FUSION)
target_link_libraries(${test_dirname} PRIVATE sycl-fusion)
endif(SYCL_ENABLE_KERNEL_FUSION)

target_include_directories(${test_dirname}
PRIVATE SYSTEM
${sycl_inc_dir}
Expand Down
4 changes: 3 additions & 1 deletion sycl/unittests/xpti_trace/QueueIDCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ TEST_F(QueueID, QueueCreationAndKernelWithDeps) {
checkTaskBeginEnd(QueueIDSTr);
}

TEST_F(QueueID, QueueCreationUSMOperations) {
// Re-enable this test after fixing
// https://github.com/intel/llvm/issues/12963
TEST_F(QueueID, DISABLED_QueueCreationUSMOperations) {
aelovikov-intel marked this conversation as resolved.
Show resolved Hide resolved
sycl::queue Q0;
auto Queue0ImplPtr = sycl::detail::getSyclObjImpl(Q0);
auto QueueIDSTr = std::to_string(Queue0ImplPtr->getQueueID());
Expand Down
Loading