Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][ESIMD] Introduce a test to validate correct processing of spirv global builtin calls #1431

Closed
wants to merge 3 commits into from
Closed

Conversation

fineg74
Copy link

@fineg74 fineg74 commented Dec 2, 2022

Complementary compiler PR intel/llvm#7590

@fineg74 fineg74 requested a review from a team as a code owner December 2, 2022 04:36
@fineg74 fineg74 changed the title [SYCL][ESIMD] Introduce a test to validate correct handling processing of spirv global builtin calls [SYCL][ESIMD] Introduce a test to validate correct processing of spirv global builtin calls Dec 13, 2022
using namespace sycl;
using namespace sycl::ext::intel::esimd;

SYCL_EXTERNAL inline size_t __spirv_GlobalInvocationId_x()
Copy link

@v-klochkov v-klochkov Dec 14, 2022

Choose a reason for hiding this comment

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

IMO, if it is E2E test, then it should not use internal functions like these.
They can be replaced with 3 dimensional nd_range passed to kernel and get x,y,z dimensions by nd_item.get_global_id(dimension)

Otherwise, if it is not E2E test, it would be better to create a test accepting LLVM IR.

for (auto Ind = 0; Ind < VL; ++Ind) {
A[I * VL + Ind] = __spirv_GlobalInvocationId_x();
B[I * VL + Ind] = __spirv_GlobalInvocationId_y();
C[I * VL + Ind] = __spirv_GlobalInvocationId_z();

Choose a reason for hiding this comment

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

What __spirv_GlobalInvocationId_z() returns when the range is only 1 dimension?

Copy link
Author

Choose a reason for hiding this comment

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

0

Choose a reason for hiding this comment

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

If it is 0 for _y, and 0 for _z, how do you know __spirv_GlobalInvocationId_z() is translated to something correct?, i.e. that it is not translated as if it was _y due to some error.

Please do not use internal functions. #1431 (comment)

@v-klochkov v-klochkov requested a review from kbobrovs December 14, 2022 02:27
@fineg74 fineg74 closed this Jan 6, 2023
@fineg74
Copy link
Author

fineg74 commented Jan 6, 2023

No longer needed as global built in calls are no longer processed in sycl-post-link

@fineg74 fineg74 deleted the syclPostLinkTruncTest branch January 6, 2023 18:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants