Skip to content

[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

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

Fznamznon
Copy link
Contributor

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]

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)));
Copy link
Contributor

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?

Copy link
Contributor Author

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 :)

@bader bader merged commit 8d186a3 into intel:sycl Jun 7, 2019
vladimirlaz pushed a commit to vladimirlaz/llvm that referenced this pull request Nov 5, 2019
  CONFLICT (content): Merge conflict in clang/include/clang/AST/PrettyPrinter.h
AlexeySachkov added a commit to AlexeySachkov/llvm that referenced this pull request Feb 11, 2020
Changes to tests are preserved

Signed-off-by: Alexey Sachkov <[email protected]>
AlexeySachkov added a commit to AlexeySachkov/llvm that referenced this pull request Feb 11, 2020
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]>
bader pushed a commit that referenced this pull request Feb 12, 2020
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants