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

Conversation

pgorlani
Copy link

This patch adds tests for intel/llvm#5801

}); \
}); \
} \
return sycl::all(r[0] == r[1]); \

Choose a reason for hiding this comment

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

I can't get purpose of sycl::all for bool converted for integer here.
What's purpose of the test?

Copy link
Author

@pgorlani pgorlani Mar 14, 2022

Choose a reason for hiding this comment

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

The purpose of the test is to check if all vector components are equal implying that the ::native function and the regular one return the same values.

Let me know if it is fine, otherwise I can change it.

Choose a reason for hiding this comment

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

Per SYCL 2020 spec, all(igeninter) Returns 1 if the most significant bit in all components of x is set; otherwise returns 0.
On line 29 a boolean is provided instead.

Copy link
Author

@pgorlani pgorlani Mar 14, 2022

Choose a reason for hiding this comment

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

Thanks for pointing this out, I misunderstood the initial message.

I think that the operator== returns a signed integer vector of size 4, in which each component is equal to -1 (all bits are set) if the corresponding elements of r[0] and r[1] have the same value, 0 otherwise (no bit is set). For reference, see Table 141.

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

For char, short, int and long it's cahr short int and long respectively. For any other type it's a mere boolean.

Copy link
Author

Choose a reason for hiding this comment

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

It depends on the size of the type. So, in the case of floats the returned vector type is made of cl_int as mandated by the SYCL specifications linked in my previous message.

@s-kanaev
Copy link

/verify with intel/llvm#5801

@pgorlani
Copy link
Author

pgorlani commented May 9, 2022

Shall you merge this PR?

@pgorlani
Copy link
Author

Hi @steffenlarsen, shall you merge this PR?

@steffenlarsen steffenlarsen merged commit 773b61e into intel:intel Jun 24, 2022
@pgorlani
Copy link
Author

Many thanks, @steffenlarsen!

myler pushed a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
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.

3 participants