Skip to content

Commit

Permalink
[SYCL] Fix typo in host impl for some math builtins (#12845)
Browse files Browse the repository at this point in the history
The ones with FP/int vector parameters were implemented incorrectly.
  • Loading branch information
aelovikov-intel committed Feb 28, 2024
1 parent 17ded8c commit 7be96cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sycl/source/builtins/math_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ __SYCL_EXPORT half sincos_impl(half x, half *p) { return __sincos(x, p); }
__SYCL_EXPORT float __##NAME##_impl(float x, int y) { return IMPL(x, y); } \
__SYCL_EXPORT double __##NAME##_impl(double x, int y) { return IMPL(x, y); } \
__SYCL_EXPORT half __##NAME##_impl(half x, int y) { return IMPL(x, y); } \
HOST_IMPL(NAME, pown /* delegate to scalar */) \
HOST_IMPL(NAME, NAME /* delegate to scalar */) \
FOR_EACH1(EXPORT_VEC_LAST_INT_1_16, NAME, FP_TYPES)

BUILTIN_MATH_LAST_INT(pown, std::pow)
Expand Down
3 changes: 3 additions & 0 deletions sycl/test-e2e/Basic/built-ins/vec_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
} \
for (int i = 0; i < DIM; i++) \
assert(abs(result[i] - EXPECTED[i]) <= DELTA); \
auto host_result = FUNC(__VA_ARGS__); \
for (int i = 0; i < DIM; i++) \
assert(abs(host_result[i] - EXPECTED[i]) <= DELTA); \
} \
}

Expand Down

0 comments on commit 7be96cf

Please sign in to comment.