Skip to content

pulldown from Sycl on 20250704 #2929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10,000 commits into
base: SYCLomatic
Choose a base branch
from

Conversation

jiejanezhang
Copy link
Contributor

pulldown from Sycl on 20250704.

aelovikov-intel and others added 30 commits June 13, 2025 15:41
…#18979)

Part of the ongoing refactoring to prefer raw ptr/ref for SYCL RT
objects by default with explicit `shared_from_this` when lifetimes need
to be extended.
These should have the potential to be more optimal for most targets, as
they emit vectorised codegen.

These were the last functions that tripped the bitwise conditional
parenthesis warning in libspirv, so that has been re-enabled.
Enabling these (or any extensions, really) by default is incorrect and
prevents the r600 OpenCL builtins from being built. Each clang target
reports which OpenCL extensions it does or doesn't support.

This commit also moves the flag enabling SPIR-V builtin declarations to
the SPIR-V options. They are not needed for the compilation of CLC or
OpenCL builtins.

There is no change to any builtins file.
The `-fsycl-device-lib-jit-link` only has an effect in SPIR compilation
so these tests would fail with `-Werror`.

It might be worth re-working these tests a bit to only run this part on
spir, but other existing tests already have this change to make it work
on `-Werror` so do it as well here to fix the nightly.

Fixes intel/llvm#18744
`sycl_ext_oneapi_graph` is not yet supported on Windows for PTL devices,
see CMPLRTST-27275
Add a basic implementation of buffers to the Offload adapter. The design
is loosely based on the CUDA and HIP adapters.

For now contexts only support a single device, so the implementation is
relatively simple. When multi-device contexts are supported we will need
to handle migration of data between devices (or otherwise change this
implementation)
…ssor` from required testing items outlined in the test plan for free function kernels extension (#18994)

This PR removes `sampled_image_accessor` and `unsampled_image_accessor`
from required testing items outlined in the test plan for free function
kernels extension. It's is done because `sampled_image_accessor` and
`unsampled_image_accessor` are not supported by any device and they're
only supported by host.
Our device compiler have been capable of automagically declaring
necessary SPIR-V built-ins on the fly for a while now, meaning that we
don't need them to be forward-declared in headers.

This PR drops includes of `__spirv_ops.hpp` so that they don't appear
anymore in `core.hpp` (and some other headers).

The header is not removed entirely, however, because not every built-in
is known to the compiler, i.e. some of them still have to be
forward-declared in the header.

Most likely there are other places which can be made free of uses of the
header and the header itself can probably be cleaned up agressively, but
I will leave it for separate future PRs.

---------

Co-authored-by: Udit Kumar Agarwal <[email protected]>
This commit adds a new property to the property set when producing
SYCLBIN files. This new property lists all kernels inside the
corresponding binaries.

---------

Signed-off-by: Larsen, Steffen <[email protected]>
Co-authored-by: Marcos Maronas <[email protected]>
This is required to ensure that the correct target with the correct
options is used when linking with clang in the test. For example without
trying to use the `SPIR-V` (not the SPIR) backend for testing with
`--param spirv-backend=True` does not take effect. If the test would be
run on a non SPIR target it would fail as clang is expecting object
files for the SPIR target when `-fsycl-targets` is not set.
…983)

Part of the ongoing refactoring to prefer raw ptr/ref for SYCL RT
objects by default with explicit `shared_from_this` when lifetimes need
to be extended.
The NVPTX target was unable to properly optimize the global ID query,
despite the user specifying the -fsycl-id-queries-fit-in-int flag.

This is because, once linked, the compiler sees the global ID builtin as
(i64 add (mul (i64 zext i32 A), (i64 zext i32 B), (i64 zext i32 C))).
Despite knowing that each of A, B and C are 32-bit values, and the final
result fits in a 32-bit value, it is not legal to replace this sequence
with (i64 zext (add i32 (mul i32 A, B), C)), which is the ideal code
here.

The solution to this problem is a new opt-in 'reflection' in the NVPTX
implementation of the global ID builtin, which selects a more optimal
version. The driver enables this reflection only when the user passes
-fsycl-id-queries-fit-in-int.
This enables building rand for CUDA and HIP and enables the test.
This PR 
1. adds **get_kernel_info** functions for kernel free functions,
[docs](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_free_function_kernels.asciidoc#new-free-functions-to-query-kernel-information-descriptors)
2. fixes bug when more than one property added with
**add_ir_attributes_funcion**, free function was not recognized as a
kernel function
The queue implementation assumed that handler.finalize() will return
either a valid (non-discarded) event or nullptr (that's why parseEvent
is nop in preview mode).

However, that was not always true. It was possible for scheduler to only
mark an event as discarded after handler.finalize() completed (during
actual command execution). This resulted in discarded event being stored
in LastEventPtr in the queue and calls to wait() on that discarded event
(which is not allowed) in MT scenarios.

Fix this, by modyfing addCG() to mark the event as discarded immediately
and to return nullptr is the event is discarded.

---------

Co-authored-by: aelovikov-intel <[email protected]>
When releasing executionEvent in the commandBuffer we need to also
retain the queue. Otherwise event->release() in commandBuffer's
destructor might attempt to release the event to an event pool that has
already been destroyed.

Also, make sure eventPool is destroyed after commandListManager to avoid
any issues with events owned by the commandListManager and move context
retain/release from commandListManager to queue/command_buffer.

The implementation of commandListManager marked move ctor and assignment
operator as defaulted which was wrong - the implementation would have to
account for context and device retain/release calls. To avoid this, move
the logic to queue/commandBuffer which can have move ctors/assignments
operators removed.
- Remove switch case for 8,16,32 now that all format int sizes are
supported.

Signed-off-by: Neil R. Spruit <[email protected]>
…026)

Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion)
from 1.1.11 to 1.1.12.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/juliangruber/brace-expansion/releases">brace-expansion's
releases</a>.</em></p>
<blockquote>
<h2>v1.1.12</h2>
<ul>
<li>pkg: publish on tag 1.x  c460dbd</li>
<li>fmt  ccb8ac6</li>
<li>Fix potential ReDoS Vulnerability or Inefficient Regular Expression
(<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/65">#65</a>)
c3c73c8</li>
</ul>
<hr />
<p><a
href="https://github.com/juliangruber/brace-expansion/compare/v1.1.11...v1.1.12">https://github.com/juliangruber/brace-expansion/compare/v1.1.11...v1.1.12</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/juliangruber/brace-expansion/commit/44f33b47c5c6a965d507421af43e86cf5971d711"><code>44f33b4</code></a>
1.1.12</li>
<li><a
href="https://github.com/juliangruber/brace-expansion/commit/c460dbd68e428d147b2080622d8ce126c7a08570"><code>c460dbd</code></a>
pkg: publish on tag 1.x</li>
<li><a
href="https://github.com/juliangruber/brace-expansion/commit/ccb8ac6d4292b7661b677fe048ba6690c877f51f"><code>ccb8ac6</code></a>
fmt</li>
<li><a
href="https://github.com/juliangruber/brace-expansion/commit/c3c73c8b088defc70851843be88ccc3af08e7217"><code>c3c73c8</code></a>
Fix potential ReDoS Vulnerability or Inefficient Regular Expression (<a
href="https://redirect.github.com/juliangruber/brace-expansion/issues/65">#65</a>)</li>
<li>See full diff in <a
href="https://github.com/juliangruber/brace-expansion/compare/1.1.11...v1.1.12">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=brace-expansion&package-manager=npm_and_yarn&previous-version=1.1.11&new-version=1.1.12)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/intel/llvm/network/alerts).

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ration header (#18929)

This PR fixes bug with templated kernel free function and its
specialization, i.e. forward declaration of specialization is emitted
into integration header too.
This feature is not supported on CUDA and HIP.

There was only one test without the unsupported directive, the
`free_function_kernels.cpp` test, but this is also tested in
`KernelAndProgram` without the image dependency flag and more
thoroughly. So since the feature is unsupported anyway it makes sense to
disable it as well.
…ress space (#19011)

In LowerWGScope pass, getSizeTTy is used as return type of local id
functions. We should use pointer size in global address space, to ensure
size_t is sufficient to represent the global range.
ianayl and others added 7 commits July 3, 2025 07:45
This PR allows changes in intel/llvm#19280 to be
tested. This PR will be open for merging if changes in #19280 are
approved.
To fix CTS test
(https://github.com/KhronosGroup/SYCL-CTS/blob/b5cf985ecc497f82045165e9309fdc7a990c7e60/tests/extension/khr_queue_empty_query/queue_empty.cpp)
failures for the `sycl_khr_queue_empty_query` extension (implemented in
intel/llvm#18799), which are caused by the error
`UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION` emitted in the old code.

---------

Signed-off-by: Hu, Peisen <[email protected]>
Add intel_cpu_spr
There is a test already, but we don't launch SPR&CPU. Tested locally.
When NumDevices is not zero and when phDevice is null, the user cannot
query the number of devices. This addresses that issue.

---------

Signed-off-by: Zhang, Winston <[email protected]>
Auto merge from sycl. Conflicts to be resolved.
Fix conflicts
@jiejanezhang jiejanezhang requested a review from a team as a code owner July 4, 2025 12:40
Copy link
Contributor

@tomflinda tomflinda left a comment

Choose a reason for hiding this comment

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

Left one comment

Address the review comments
Copy link
Contributor

@tomflinda tomflinda left a comment

Choose a reason for hiding this comment

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

Local verification passed(including build pass+ lit tests pass)

[83/84] Running lit suite /mnt/hdd/Chenwei/Repo/SYCLomatic/clang/test/dpct
llvm-lit: /mnt/hdd/Chenwei/Repo/SYCLomatic/llvm/utils/lit/lit/llvm/config.py:520: note: using clang: /mnt/hdd/Chenwei/Repo/build_release/bin/clang
llvm-lit: /mnt/hdd/Chenwei/Repo/SYCLomatic/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find cir-opt in /mnt/hdd/Chenwei/Repo/build_release/bin:/mnt/hdd/Chenwei/Repo/build_release/bin

Testing Time: 1158.84s

Total Discovered Tests: 1277
  Unsupported:   73 (5.72%)
  Passed     : 1204 (94.28%)

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.