[SYCL][bfloat16] Simplify bfloat16 class #17258
Open
+454
−439
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.
This change makes a few changes aiming to make the code more readable.
Move declaration of the bfloat16 class right on top of the header file
and move all declarations with the implementation helpers after the
class declaration.
Converted ConvertToBfloat16 class to namespace. The class doesn't
represent any object, it's a collection of static methods.
Declare public API of the class first.
Define bfloat16 class as final.
Move Bfloat16StorageT declaration from the detail namespace directly
into bfloat16 class definition.
Co-locate declaration of functions with similar functionality (e.g.
conversion functions).
Simplified uniry operator- implementation by removing additional
branch for the SPIR target. Generic code for SPIR target produces
exactly the same code.
Added compile time checks for the array size inside conversion helper
functions. Device side implementation of these functions work
correctly only for certain array sizes.
Include C++ header instead of C (i.e. cstdint instead of stdint.h).
Applied "no-else-after-return" and "no-braces-for-single-statement-if"
coding style changes.