Skip to content
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

[SYCL][COMPAT] Added 33 bit extend operations with and without saturation #13006

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

Alcpz
Copy link
Contributor

@Alcpz Alcpz commented Mar 13, 2024

Adds support for addition, substraction, min, and max operations extended from 32 to 33 bit.
Adds an extra API for each operation where a transform binaryop can be applied to the result of the defined extend operation.


#ifdef SYCL_EXT_ONEAPI_BFLOAT16_MATH_FUNCTIONS
template <>
inline sycl::ext::oneapi::bfloat16 clamp(sycl::ext::oneapi::bfloat16 val,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add these directly to the existing bfloat16 extension? So users don't need to mix and max namespaces?
https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_bfloat16_math_functions.asciidoc

This comment was marked as duplicate.

Copy link
Contributor Author

@Alcpz Alcpz Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a TODO regarding this. If SYCL users need this type for clamp, they should not go through the syclcompat version. If it gets added to the bfloat extension, it is sensible to remove this from syclcompat.

sycl/include/syclcompat/math.hpp Outdated Show resolved Hide resolved
@Alcpz
Copy link
Contributor Author

Alcpz commented Apr 11, 2024

@intel/llvm-gatekeepers this is ready for merging, thanks

@steffenlarsen steffenlarsen merged commit 8863358 into intel:sycl Apr 12, 2024
13 checks passed
@Alcpz Alcpz deleted the Alcpz/math-extend branch June 3, 2024 12:20
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