-
Notifications
You must be signed in to change notification settings - Fork 807
[SYCL] Put constant initializer list data in non-generic addr space. #3005
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
979f66c
[SYCL] Put constant initializer list data in non-generic addr space.
kbobrovs d739cc6
Fix clang formatting.
kbobrovs 438cb53
Removed redundant code from the test per review.
kbobrovs 30eb47f
added missing colon to the test per code review
kbobrovs 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 hidden or 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 hidden or 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,34 @@ | ||
// RUN: %clang_cc1 -fsycl -fsycl-is-device -triple spir64-unknown-unknown-sycldevice \ | ||
// RUN: -emit-llvm -o - %s | FileCheck %s | ||
|
||
// This test checks that data for big constant initializer lists is placed | ||
// into the global address space by the SYCL compiler. | ||
|
||
struct Test { | ||
Test() : set{ | ||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | ||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 | ||
// CHECK-DAG: @constinit = private unnamed_addr addrspace(1) constant | ||
// CHECK: [32 x i32] | ||
// CHECK: [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, | ||
// CHECK: i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, | ||
// CHECK: i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, | ||
// CHECK: i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15 | ||
// CHECK ], align 4 | ||
// CHECK-NOT: @constinit = private unnamed_addr addrspace(0) | ||
// CHECK-NOT: @constinit = private unnamed_addr addrspace(2) | ||
// CHECK-NOT: @constinit = private unnamed_addr addrspace(3) | ||
// CHECK-NOT: @constinit = private unnamed_addr addrspace(4) | ||
} {}; | ||
int set[32]; | ||
}; | ||
|
||
__attribute__((sycl_device)) void bar(Test &x); | ||
|
||
__attribute__((sycl_device)) void zoo(int *y) { | ||
const int vec[] = { | ||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | ||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; | ||
Test mc; | ||
bar(mc); | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.