-
Notifications
You must be signed in to change notification settings - Fork 738
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
[SYCL] Use static
address space cast for atomic_ref
ctor in SPIR-V path
#15384
Merged
aelovikov-intel
merged 11 commits into
intel:sycl
from
aelovikov-intel:atomic-ref-static-as-cast
Sep 18, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0e5d540
[SYCL] Add a test for generated device code for `atomic_ref`
aelovikov-intel a22d4bd
[SYCL] Use `static` address space cast for `atomic_ref` ctor in SPIR-…
aelovikov-intel 21c3f33
[SYCL] Add a test showing issues with sycl_ext_oneapi_address_cast impl
aelovikov-intel 7d4af87
[SYCL] Fix `static|dynamic_address_cast` to `generic`
aelovikov-intel b30b1c4
Merge remote-tracking branch 'my/atomic-ref-static-as-cast' into HEAD
aelovikov-intel d40110d
clang-format
aelovikov-intel f052b05
Disable newly added test on Windows
aelovikov-intel 78cde19
Merge remote-tracking branch 'my/fix-casts' into HEAD
aelovikov-intel fd7848b
Merge remote-tracking branch 'origin/sycl' into HEAD
aelovikov-intel d62ab6d
Merge remote-tracking branch 'origin/sycl' into HEAD
aelovikov-intel 56e8f2f
Update the fix to the recent extension change
aelovikov-intel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 | ||
// RUN: %clangxx -O3 -fsycl -fsycl-device-only -fno-discard-value-names -S -emit-llvm -fno-sycl-instrument-device-code -o - %s | FileCheck %s | ||
|
||
#include <sycl/sycl.hpp> | ||
|
||
// CHECK-LABEL: define dso_local spir_func noundef i32 @_Z17atomic_ref_globalRi( | ||
// CHECK-SAME: ptr addrspace(4) noundef align 4 dereferenceable(4) [[I:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] !srcloc [[META6:![0-9]+]] !sycl_fixed_targets [[META7:![0-9]+]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: [[CALL_I_I_I_I_I_I:%.*]] = tail call spir_func noundef ptr addrspace(1) @_Z33__spirv_GenericCastToPtr_ToGlobalPvi(ptr addrspace(4) noundef [[I]], i32 noundef 5) #[[ATTR3:[0-9]+]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One can review individual commits in this PR to see before/after change. |
||
// CHECK-NEXT: [[CALL3_I_I:%.*]] = tail call spir_func noundef i32 @_Z18__spirv_AtomicLoadPU3AS1KiN5__spv5Scope4FlagENS1_19MemorySemanticsMask4FlagE(ptr addrspace(1) noundef [[CALL_I_I_I_I_I_I]], i32 noundef 1, i32 noundef 898) #[[ATTR4:[0-9]+]] | ||
// CHECK-NEXT: ret i32 [[CALL3_I_I]] | ||
// | ||
SYCL_EXTERNAL auto atomic_ref_global(int &i) { | ||
// Verify that we use _Z33__spirv_GenericCastToPtr_ToGlobalPvi that doesn't | ||
// perform dynamic address space validation. | ||
sycl::atomic_ref<int, sycl::memory_order::acq_rel, sycl::memory_scope::device, | ||
sycl::access::address_space::global_space> | ||
a(i); | ||
return a.load(); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is feature test macro
SYCL_EXT_ONEAPI_ADDRESS_CAST
not defined for the__SPIR__
case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extension implementation seems to have missed that completely. I'm making other changes to the extension, will work on that outside this PR.