Skip to content
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] Change some check_device_code tests to use SYCL_EXTERNAL #13899

Merged
merged 2 commits into from
May 27, 2024

Conversation

ianayl
Copy link
Contributor

@ianayl ianayl commented May 23, 2024

Changed some of the simpler test cases to use SYCL_EXTERNAL functions instead of submitting to a queue.

@ianayl ianayl requested a review from a team as a code owner May 23, 2024 19:09
@ianayl ianayl requested a review from sergey-semenov May 23, 2024 19:09
@sergey-semenov sergey-semenov changed the title [SYCL] Changed some check_device_code tests to use SYCL_EXTERNAL [SYCL] Change some check_device_code tests to use SYCL_EXTERNAL May 24, 2024
@ianayl ianayl temporarily deployed to WindowsCILock May 24, 2024 13:42 — with GitHub Actions Inactive
@ianayl ianayl temporarily deployed to WindowsCILock May 24, 2024 14:23 — with GitHub Actions Inactive
@sergey-semenov sergey-semenov merged commit 309b167 into intel:sycl May 27, 2024
13 checks passed
@@ -13,12 +13,9 @@ const intel::fpga_datapath<int[10]> empty{};
// CHECK: %[[datapath:.*]] = type { [10 x i32] }
// CHECK: {{.*}}empty = internal addrspace(1) constant %[[datapath]] zeroinitializer, align 4, !spirv.Decorations ![[empty_md:[0-9]*]]

int main() {
queue Q;
SYCL_EXTERNAL void fpga_datapath_global() {
Copy link
Contributor

Choose a reason for hiding this comment

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

JFYI: I think f should have been made an argument for the change to be a no-op (it was previously a kernel argument because of the lambda capture), but it likely doesn't matter here.


Q.single_task([=]() { volatile int ReadVal = empty[f]; });
return 0;
volatile int ReadVal = empty[f];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the purpose of this volatile int was to prevent the optimizer from removing everything. In the new approach the idiomatic way would be to just return that int value, e.g.

SYCL_EXTERNAL auto /* or int, maybe */ fpga_datapath_global(int f) { return emtpy[f]; }

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.

3 participants