SimSYCL icon indicating copy to clipboard operation
SimSYCL copied to clipboard

Implement SYCL_KHR_WORK_ITEM_QUERIES

Open PeterTh opened this issue 5 months ago • 2 comments

This adds support for the SYCL_KHR_WORK_ITEM_QUERIES extension, as per https://github.com/KhronosGroup/SYCL-Docs/pull/682.

Although SimSYCL is a library-only implementation, due to its single-threaded nature this can be implemented via thread locals that are set every time a kernel function context is scheduled in. The actual implementation is a bit more convoluted than I'd like, but it does provide decent error messages / developer experience.

PeterTh avatar Aug 31 '25 18:08 PeterTh

You mean as it relates to threading by the user program? In any case, I see no problem with making them thread local, so I'll do that.

Since you're here (😛), in the new unit test introduced in this PR there's this. I adopted the whole test from here, but was surprised that it didn't actually fail when I expected it to. It looks to me like the original version never runs because the global range at dim 0 is 0, but I didn't yet check if there was just something I missed when adapting it.

PeterTh avatar Aug 31 '25 20:08 PeterTh

Switched to thread locals now.

PeterTh avatar Sep 01 '25 10:09 PeterTh