-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Remove _Float16 from integration header #185
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
Conversation
The main problem that half type is defined as _Float16 on the device and as manually implemented type on host so compiler could add _Float16 to the integration header and it will produce errors in host compilation. Signed-off-by: Mariya Podchishchaeva <[email protected]>
@@ -180,6 +172,7 @@ int main() { | |||
check<aligned_short, 4>(Queue); | |||
check<aligned_short, 8>(Queue); | |||
if (Queue.get_device().has_extension("cl_khr_fp16")) { | |||
typedef half aligned_half __attribute__((aligned(16))); |
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.
What about using
instead in 2019?
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.
This test uses typedef
in all places so I used it to save one style. I think changing all typedefs
to usings
not in scope of this PR :)
CONFLICT (content): Merge conflict in clang/include/clang/AST/PrettyPrinter.h
Changes to tests are preserved Signed-off-by: Alexey Sachkov <[email protected]>
Because of the fact, that `half` type is not a standard C++ type and it is not supported everywhere, its implementation differs between host and device: C++ class with overloaded arithmetic operators is used on host and `_Float16` is used on device side. Previously, the switch between two version was implemented as preprocessor macro and having two different types caused some problems with integration header and unnamed lambda feature, see intel#185 and intel#960. This patch redesigned `half` implementation in a way, that single wrapper data type is used as `half` representation on both host and device sides; differentiation between actual host and device implementations is done under the hood of this wrapper. Signed-off-by: Alexey Sachkov <[email protected]>
…rounds (#1089) Because of the fact, that `half` type is not a standard C++ type and it is not supported everywhere, its implementation differs between host and device: C++ class with overloaded arithmetic operators is used on host and `_Float16` is used on device side. Previously, the switch between two version was implemented as preprocessor macro and having two different types caused some problems with integration header and unnamed lambda feature, see #185 and #960. This patch redesigned `half` implementation in a way, that single wrapper data type is used as `half` representation on both host and device sides; differentiation between actual host and device implementations is done under the hood of this wrapper. Signed-off-by: Alexey Sachkov <[email protected]>
The main problem that half type is defined as _Float16 on the device and
as manually implemented type on host so compiler could add _Float16
to the integration header and it will produce errors in host
compilation.
Signed-off-by: Mariya Podchishchaeva [email protected]