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

[SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test #830

Merged
merged 4 commits into from Feb 22, 2022
Merged

[SYCL] Extend the SpecConstants/vector-convolution-demo.cpp test #830

merged 4 commits into from Feb 22, 2022

Conversation

ghost
Copy link

@ghost ghost commented Feb 11, 2022

The test is extended with a specialization constant built upon an aligned
structure. The CFE generates a padding represented as '[size x i8] undef' for
such structures and the sycl-post-link tool crashed during property set
generation for the specialization constant. The bug has been fixed in
intel/llvm#5538, this extension is the E2E test for the fix to ensure that
the default values and offsets given to the runtime are correct.

Signed-off-by: Pavel Samolysov [email protected]

@ghost ghost self-requested a review as a code owner February 11, 2022 07:06
@ghost ghost marked this pull request as draft February 11, 2022 07:06
@ghost ghost requested a review from steffenlarsen February 11, 2022 07:07
The test is extended with a specialization constant built upon an aligned
structure. The CFE generates a padding represented as '[size x i8] undef' for
such structures and the sycl-post-link tool crashed during property set
generation for the specialization constant. The bug has been fixed in
intel/llvm#5538, this extension is the E2E test for the fix to ensure that
the default values and offsets given to the runtime are correct.

Signed-off-by: Pavel Samolysov <[email protected]>
AlexeySachkov
AlexeySachkov previously approved these changes Feb 11, 2022
constexpr specialization_id<coeff_t> coeff_id;

constexpr specialization_id<coeff_struct_t> coeff_struct_id;

constexpr specialization_id<coeff_struct_aligned_t> coeff_struct_aligned_id;

Choose a reason for hiding this comment

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

It may make the test look a little odd, but would it make sense to have two of these? In that case we are sure that one will appear before another spec constant and we can be sure that the calculated offset isn't affected by the padding.

Copy link
Author

@ghost ghost Feb 11, 2022

Choose a reason for hiding this comment

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

@steffenlarsen Thank you for the comment. I'm sorry, maybe I've got your comment wrong. Should I add another spec constant with the same type as specialization_id<coeff_struct_aligned_t>, or just remove the constexpr specialization_id<coeff_struct_t> coeff_struct_id one because it has no padding and if the constant with padding has been processed well, the constant without padding should also be processed?

Choose a reason for hiding this comment

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

My worry is that the changes to sycl-post-link could make it difficult for the runtime to correctly calculate the sizes and offsets of the specialization constants with padding. If the padded specialization constant is the last specialization constant we would likely not see this as there is no following specialization constant and as such the amount of padding does not matter to the runtime. Adding an extra specialization constant with specialization_id<coeff_struct_aligned_t> would ensure at least one of them isn't the last specialization constant, right?

Copy link
Author

Choose a reason for hiding this comment

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

@steffenlarsen Thank you very much for the explanation, it's crystal clear now. I've added a new specialization constant after coeff_struct_aligned_id but I see locally the test failed (in fact, it failed even with one specialization constant containing padding). The test works!

Pavel Samolysov added 2 commits February 15, 2022 14:18
An extra specialization constant is required to check whether the runtime
correctly calculates the sizes and offsets of the specialization constants
with padding.

Signed-off-by: Pavel Samolysov <[email protected]>
Signed-off-by: Pavel Samolysov <[email protected]>
@ghost ghost marked this pull request as ready for review February 21, 2022 08:19
@ghost ghost requested a review from mlychkov February 21, 2022 08:19
@ghost
Copy link
Author

ghost commented Feb 21, 2022

@mlychkov @steffenlarsen @AlexeySachkov The fix has been merged into intel/llvm, all the tests pass. Could you review again?

@ghost ghost self-requested a review February 21, 2022 08:29
@AlexeySachkov AlexeySachkov merged commit a621ef9 into intel:intel Feb 22, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Apr 12, 2022
…el#830)

The test is extended with a specialization constant built upon an aligned
structure. The CFE generates a padding represented as '[size x i8] undef' for
such structures and the sycl-post-link tool crashed during property set
generation for the specialization constant. The bug has been fixed in
intel/llvm#5538, this extension is the E2E test for the fix to ensure that
the default values and offsets given to the runtime are correct.

Signed-off-by: Pavel Samolysov <[email protected]>
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Jun 17, 2022
…el#830)

The test is extended with a specialization constant built upon an aligned
structure. The CFE generates a padding represented as '[size x i8] undef' for
such structures and the sycl-post-link tool crashed during property set
generation for the specialization constant. The bug has been fixed in
intel/llvm#5538, this extension is the E2E test for the fix to ensure that
the default values and offsets given to the runtime are correct.

Signed-off-by: Pavel Samolysov <[email protected]>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…el/llvm-test-suite#830)

The test is extended with a specialization constant built upon an aligned
structure. The CFE generates a padding represented as '[size x i8] undef' for
such structures and the sycl-post-link tool crashed during property set
generation for the specialization constant. The bug has been fixed in
intel#5538, this extension is the E2E test for the fix to ensure that
the default values and offsets given to the runtime are correct.

Signed-off-by: Pavel Samolysov <[email protected]>
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