Skip to content

[MAINT] Run C-API tests in the OS compiler workflows - #2435

Open
ndgrigorian wants to merge 12 commits into
masterfrom
ci/capi-tests-os-compiler
Open

ndgrigorian wants to merge 12 commits into
masterfrom
ci/capi-tests-os-compiler

Conversation

@ndgrigorian

@ndgrigorian ndgrigorian commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

This PR proposes building and running the libsyclinterface C-API tests in both workflows using the OS compiler. So far they have only run in the coverage workflow.

This PR also fixes the Windows workflow, which has been failing since the OS compiler stopped installing the OpenCL ICD loader with the toolchain with:

CMake Error at .../FindPackageHandleStandardArgs.cmake:290 (message):
  Could NOT find IntelSyclCompiler (missing:
  IntelSyclCompiler_OPENCL_LIBRARY)

FindIntelSyclCompiler no longer looks for the loader, which dpctl loads at run time, and the C-API tests no longer link it, as they make no OpenCL calls. They no longer link libdl either, as they make no dlopen calls. The Linux workflow was not affected, as it copies libOpenCL.so from the CPU runtime into the nightly

To make the tests work with the open source compiler, ChkDPCPPVersion also accepts the version from __clang_version__, as IntelSyclCompiler_VERSION is the clang version, which __VERSION__ of the nightly does not contain. On Windows, DPCTLSyclInterface.dll is copied next to the test executable, as test discovery runs it right after linking

GTest is installed from apt on Linux, and built from source on Windows with the shared CRT to match -fsycl

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

@coveralls

coveralls commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 75.173%. remained the same — ci/capi-tests-os-compiler into master

jharlow-intel and others added 5 commits December 2, 2026 00:03
intel/llvm#23807 stopped installing the OpenCL ICD loader with the SYCL
toolchain, so nightly builds from 2026-11-12 on have no lib/OpenCL.lib on
Windows and the module failed to find the compiler. dpctl loads the
loader at run time, and only the C-API tests link it, so the module now
sets IntelSyclCompiler_OPENCL_LIBRARY only if the toolchain has it, and
dpctl_c_api_tests links it when set.
open source DPC++ reports its clang version, which __VERSION__ does not contain
test discovery runs the executable after the link
install GTest from apt on Linux and build it from source on Windows
@ndgrigorian
ndgrigorian force-pushed the ci/capi-tests-os-compiler branch from c5b40e4 to 4665235 Compare December 2, 2026 08:04
antonwolfy
antonwolfy previously approved these changes Dec 2, 2026

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! The two inline comments are optional nits.

The failing build_linux/build_windows jobs in one of the "Conda package" runs are unrelated: conda raises InvalidSpec while parsing a package spec, and the "Conda package" run on master fails the same way (e.g. after #2433).

Comment thread libsyclinterface/tests/test_service.cpp Resolved
Fail if _skbuild has more or less than one build directory, and pass it to the C-API test step through BUILD_DIR
Nothing in the tests calls OpenCL directly, and libDPCTLSyclInterface loads
the loader at run time, so drop the lookup of IntelSyclCompiler_OPENCL_LIBRARY.
The tests make no dlopen calls.

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test binary no longer links libOpenCL. dpctl's tests pass on GPU and CPU. A few small comments below:

Comment thread libsyclinterface/tests/test_service.cpp Resolved
Also remove the copy that earlier runs left in the cached bundle, so CI builds without a bundled loader
A failed C-API test build no longer skips dpctl/tests

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants