Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ specification.

This extension adds `bfloat16` support to the `fma`, `fmin`, `fmax`, `fabs`,
`isnan`, `ceil`, `floor`, `cos`, `sin`, `exp`, `exp2`, `exp10`, `log`, `log2`,
`log10`, `rint`, `sqrt`, `rsqrt` and `trunc` SYCL floating point math functions.
These functions can be used as element wise operations on matrices, supplementing
the `bfloat16` support in the sycl_ext_oneapi_matrix extension.
`log10`, `rint`, `sqrt`, `rsqrt`, `trunc` and `tanh` SYCL floating point math
functions. These functions can be used as element wise operations on matrices,
supplementing the `bfloat16` support in the sycl_ext_oneapi_matrix extension.

The descriptions of the `fma`, `fmin`, `fmax`, `fabs`, `isnan`, `ceil`, `floor`,
`cos`, `sin`, `exp`, `exp2`, `exp10`, `log`, `log2`, `log10`, `rint`, `sqrt`,
`rsqrt` and `trunc` SYCL floating point math functions can be found in the SYCL
specification:
`rsqrt`, `trunc` and `tanh` SYCL floating point math functions can be found in
the SYCL specification:
https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#_math_functions.

[NOTE]
Expand Down
4 changes: 4 additions & 0 deletions sycl/include/sycl/ext/oneapi/experimental/bfloat16_math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ BFLOAT16_MATH_FP32_WRAPPERS(trunc)
BFLOAT16_MATH_FP32_WRAPPERS_MARRAY(trunc)
BFLOAT16_MATH_FP32_WRAPPERS_VEC(trunc)

BFLOAT16_MATH_FP32_WRAPPERS(tanh)
BFLOAT16_MATH_FP32_WRAPPERS_MARRAY(tanh)
BFLOAT16_MATH_FP32_WRAPPERS_VEC(tanh)

#undef BFLOAT16_MATH_FP32_WRAPPERS
#undef BFLOAT16_MATH_FP32_WRAPPERS_MARRAY
#undef BFLOAT16_MATH_FP32_WRAPPERS_VEC
Expand Down
1 change: 1 addition & 0 deletions sycl/test-e2e/BFloat16/bfloat16_builtins.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ void test() {
TEST(exp10, 1);
TEST(exp2, 1);
TEST(rint, 1);
TEST(tanh, 1);

// log, log2, log10, sqrt, rsqrt testing, the input
// must be positive.
Expand Down