[SYCL] Rework 'half' implementation in order to remove bunch of workarounds#1089
Merged
bader merged 3 commits intointel:syclfrom Feb 12, 2020
Merged
Conversation
s-kanaev
reviewed
Feb 4, 2020
AlexeySachkov
commented
Feb 4, 2020
b07dd2c to
970468a
Compare
MrSidims
reviewed
Feb 11, 2020
Contributor
sergey-semenov
left a comment
There was a problem hiding this comment.
LGTM aside from some nitpicks
The only file left is `sycl/test/regression/fp16-with-unnamed-lambda.cpp` Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
Changes to tests are preserved Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
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 <alexey.sachkov@intel.com>
970468a to
5d8ac20
Compare
sergey-semenov
approved these changes
Feb 12, 2020
Fznamznon
reviewed
Feb 12, 2020
Contributor
Fznamznon
left a comment
There was a problem hiding this comment.
+1 for compiler changes.
s-kanaev
approved these changes
Feb 12, 2020
Contributor
|
Great work, @AlexeySachkov! |
AlexeySachkov
added a commit
to AlexeySachkov/llvm
that referenced
this pull request
Feb 18, 2020
Error was reproducible in two cases: - using something like `numeric_limits<half>::min()` in within another `constexpr` - not treating SYCL headers as system ones with `-Winvalid-constexpr` treated as error Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
bader
pushed a commit
that referenced
this pull request
Feb 25, 2020
Error was reproducible in two cases: - using something like `numeric_limits<half>::min()` in within another `constexpr` - not treating SYCL headers as system ones with `-Winvalid-constexpr` treated as error Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
vmaksimo
pushed a commit
to vmaksimo/llvm
that referenced
this pull request
Jul 5, 2021
* Implement SPV_INTEL_debug_module extension Spec intel#3976 Original commit: KhronosGroup/SPIRV-LLVM-Translator@2b3a2f3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because of the fact, that
halftype is not a standard C++ type and it isnot supported everywhere, its implementation differs between host and
device: C++ class with overloaded arithmetic operators is used on host
and
_Float16is 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 (these patches are partially reverted in this PR).
This PR redesigned
halfimplementation in a way, that singlewrapper data type is used as
halfrepresentation on both host anddevice sides; differentiation between actual host and device
implementations is done under the hood of this wrapper.