Skip to content

[SYCL][UR] Bindless Image -- win32 named handles converted to UTF-8 when passed to L0 - #23199

Open
cperkinsintel wants to merge 10 commits into
intel:syclfrom
cperkinsintel:cperkins-win32-named-handle-UTF8-for-L0
Open

cperkinsintel wants to merge 10 commits into
intel:syclfrom
cperkinsintel:cperkins-win32-named-handle-UTF8-for-L0

Conversation

@cperkinsintel

@cperkinsintel cperkinsintel commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

win32 named handles are normally UTF-16, but on the L0 driver side the ones for semaphores are UTF-8. Ultimately, this will be redesigned, but the API is out there, published, and there is nothing to be done about it in the short term. So SYCL is taking the UTF-16 and converting to UTF-8.

@cperkinsintel
cperkinsintel marked this pull request as ready for review October 2, 2026 16:43
@cperkinsintel
cperkinsintel requested review from a team as code owners October 2, 2026 16:43
@cperkinsintel
cperkinsintel requested review from 0x12CC and a balanced review from Copilot October 2, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

This PR fixes Win32 named external semaphore import on Level Zero by converting UTF-16 NT object names from SYCL/UR into UTF-8 strings expected by the L0 semaphore import path, and adds/updates end-to-end coverage and documentation for named-handle interop.

Changes:

  • Add Win32-only UTF-16 → UTF-8 conversion for named semaphore import in the Level Zero UR adapter.
  • Add a new Vulkan E2E test for named timeline semaphore import (including non-ASCII name coverage).
  • Re-enable/extend the D3D12 named semaphore E2E test and clarify docs around resource_win32_name string type/lifetime.
File Description
unified-runtime/​source/​adapters/​level_zero/​common/​image_common.cpp Introduces Win32-only UTF-16→UTF-8 conversion and applies it to the semaphore-by-name import path.
sycl/​test-e2e/​bindless_images/​vulkan_interop/​vulkan_win32_named_timeline_semaphore.cpp New E2E Vulkan test validating named timeline semaphore import and UTF-16 round-trip behavior.
sycl/​test-e2e/​bindless_images/​dx12_interop/​D3D12_win32_named_semaphore.cpp Re-enables the test for Intel driver and adds non-ASCII name coverage + safer wide-name printing.
sycl/​test-e2e/​bindless_images/​dx12_interop/​D3D12_win32_named_memory.cpp Updates unsupported tracker and clarifies why named memory import remains unsupported.
sycl/​doc/​extensions/​experimental/​sycl_ext_oneapi_bindless_images.asciidoc Documents resource_win32_name::name as LPCWSTR and clarifies storage lifetime expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread unified-runtime/source/adapters/level_zero/common/image_common.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/common/image_common.cpp Outdated
Comment thread unified-runtime/source/adapters/level_zero/common/image_common.cpp

@dyniols dyniols left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bindless images part LGTM.

I agree with @ldorau that the issue with the string that it must outlive the import call has to be resolved before merge.
https://github.com/intel/llvm/pull/23199/changes#r4193219873

@cperkinsintel
cperkinsintel requested a review from dyniols October 6, 2026 22:00
D3D12NamedFence extFence =
createNamedExportableFence(d3dCtx, L"Global\\SYCLTestNamedFence");
// Non-ASCII name (Chiqué气) verifies UTF-16 codepoints round-trip through
// import But rather than "Chiqué气" directly, we use escapes so MSVC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But -> but

@ldorau ldorau changed the title [SYCL][UR] Bindlesss Image -- win32 named handles converted to UTF-8 when passed to L0 [SYCL][UR] Bindless Image -- win32 named handles converted to UTF-8 when passed to L0 Oct 7, 2026
@ldorau

ldorau commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

I fixed typo in the title: "Bindlesss" -> "Bindless"

@sys-ce-bb

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

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