Skip to content

[SYCL][Unit] Fix crash when user sets ONEAPI_DEVICE_SELECTOR in shell#22684

Merged
againull merged 1 commit into
intel:syclfrom
wenju-he:fix-sycl-unit-ONEAPI_DEVICE_SELECTOR
Jul 21, 2026
Merged

[SYCL][Unit] Fix crash when user sets ONEAPI_DEVICE_SELECTOR in shell#22684
againull merged 1 commit into
intel:syclfrom
wenju-he:fix-sycl-unit-ONEAPI_DEVICE_SELECTOR

Conversation

@wenju-he

Copy link
Copy Markdown
Contributor

The mock adapter is not a real device backend, but ONEAPI_DEVICE_SELECTOR and SYCL_DEVICE_FILTER are still applied to it by platform_impl. If either is set in the ambient shell to a backend that doesn't match UrMock's declared Backend (opencl by default), the mock device gets filtered out and every mock-based unit test aborts with "No device of requested type available" instead of running deterministically.

Clear both env vars at the top of the UrMock constructor, before any SYCL runtime code caches their value.

Fixes case 1 in #22683.

The mock adapter is not a real device backend, but ONEAPI_DEVICE_SELECTOR
and SYCL_DEVICE_FILTER are still applied to it by platform_impl. If either
is set in the ambient shell to a backend that doesn't match UrMock's
declared Backend (opencl by default), the mock device gets filtered out
and every mock-based unit test aborts with "No device of requested type
available" instead of running deterministically.

Clear both env vars at the top of the UrMock constructor, before any SYCL
runtime code caches their value.

Fixes case 1 in intel#22683.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@wenju-he
wenju-he requested a review from a team as a code owner July 20, 2026 05:59
@wenju-he
wenju-he requested a review from dm-vodopyanov July 20, 2026 05:59
@wenju-he

Copy link
Copy Markdown
Contributor Author

@intel/llvm-gatekeepers please merge, thanks. This PR fixes local check-sycl-unittests. e2e fails on BMG are unrelated.

@againull
againull merged commit 841c675 into intel:sycl Jul 21, 2026
30 of 31 checks passed
@wenju-he
wenju-he deleted the fix-sycl-unit-ONEAPI_DEVICE_SELECTOR branch July 21, 2026 04:48
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.

3 participants