-
Notifications
You must be signed in to change notification settings - Fork 130
[SYCL] Add --ffast-math tests #919
Conversation
}); \ | ||
}); \ | ||
} \ | ||
return sycl::all(r[0] == r[1]); \ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. operator==
on host return vector of rel_t
which is defined here https://github.com/intel/llvm/blob/cb5e8ae54d2e55e9edc0bad35b57fcad39e4f090/sycl/include/CL/sycl/types.hpp#L124
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
/verify with intel/llvm#5801 |
Shall you merge this PR? |
8b04bc4
to
03b4f17
Compare
03b4f17
to
c493400
Compare
Hi @steffenlarsen, shall you merge this PR? |
Many thanks, @steffenlarsen! |
This patch adds tests for intel/llvm#5801
This patch adds tests for intel#5801
This patch adds tests for intel/llvm#5801