Skip to content

Conversation

@uditagarwal97
Copy link
Contributor

No description provided.

@uditagarwal97 uditagarwal97 marked this pull request as ready for review January 7, 2026 19:14
@uditagarwal97 uditagarwal97 requested a review from a team as a code owner January 7, 2026 19:14
@sarnex
Copy link
Contributor

sarnex commented Jan 7, 2026

I think this is throwing the below then hanging in check-sycl or check-sycl-unittests

/__w/llvm/llvm/build/bin/clang --driver-mode=g++  -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx90a -fsycl /__w/llvm/llvm/src/sycl/test/regression/queue_submit.cpp -o /__w/llvm/llvm/build/tools/sycl/test/regression/Output/queue_submit.cpp.tmp.out
# executed command: /__w/llvm/llvm/build/bin/clang --driver-mode=g++ -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx90a -fsycl /__w/llvm/llvm/src/sycl/test/regression/queue_submit.cpp -o /__w/llvm/llvm/build/tools/sycl/test/regression/Output/queue_submit.cpp.tmp.out
# .---command stderr------------
# | clang: warning: argument unused during compilation: '-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx90a' [-Wunused-command-line-argument]
# `-----------------------------
# RUN: at line 4
/__w/llvm/llvm/build/tools/sycl/test/regression/Output/queue_submit.cpp.tmp.out
# executed command: /__w/llvm/llvm/build/tools/sycl/test/regression/Output/queue_submit.cpp.tmp.out
# .---command stderr------------
# | terminate called after throwing an instance of 'sycl::_V1::exception'
# |   what():  The kernel bundle does not contain the kernel identified by kernelId.
# `-----------------------------
# error: command failed with exit status: -6
--

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a race condition in kernel_impl::getName() that could occur when multiple threads concurrently access the same kernel object. The fix ensures thread-safe lazy initialization of the kernel name using std::call_once.

Key changes:

  • Added thread-safe lazy initialization to kernel_impl::getName() using std::call_once
  • Added regression test to verify concurrent kernel submission to the same queue works correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
sycl/source/detail/kernel_impl.cpp Implements thread-safe lazy initialization of kernel name using std::call_once and std::once_flag
sycl/test-e2e/Regression/queue_submit.cpp Adds regression test that submits the same kernel from multiple threads to verify the race condition fix

Copy link
Contributor

@sergey-semenov sergey-semenov left a comment

Choose a reason for hiding this comment

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

LGTM overall

@uditagarwal97
Copy link
Contributor Author

Failure in SpecConstants/2020/nested-non-packed-struct.cpp on CUDA is unrelated: #17650

@uditagarwal97 uditagarwal97 merged commit 0ec5502 into sycl Jan 8, 2026
35 of 38 checks passed
@uditagarwal97 uditagarwal97 deleted the private/udit/kernel_name_race branch January 8, 2026 18: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.

4 participants