Skip to content

Commit 7e50422

Browse files
authored
[SYCL] Fix unused parameter warnings in bf16 storage builtins (#5811)
When compiling for host, the functions had unused parameters which resulted in warnings and errors with -Werr. This fixes the issue.
1 parent c86ac9a commit 7e50422

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sycl/include/sycl/ext/oneapi/bf16_storage_builtins.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ std::enable_if_t<detail::is_bf16_storage_type<T>::value, T> fabs(T x) {
4141
#ifdef __SYCL_DEVICE_ONLY__
4242
return __clc_fabs(x);
4343
#else
44+
(void)x;
4445
throw runtime_error("bf16 is not supported on host device.",
4546
PI_INVALID_DEVICE);
4647
#endif
@@ -50,6 +51,8 @@ std::enable_if_t<detail::is_bf16_storage_type<T>::value, T> fmin(T x, T y) {
5051
#ifdef __SYCL_DEVICE_ONLY__
5152
return __clc_fmin(x, y);
5253
#else
54+
(void)x;
55+
(void)y;
5356
throw runtime_error("bf16 is not supported on host device.",
5457
PI_INVALID_DEVICE);
5558
#endif
@@ -59,6 +62,8 @@ std::enable_if_t<detail::is_bf16_storage_type<T>::value, T> fmax(T x, T y) {
5962
#ifdef __SYCL_DEVICE_ONLY__
6063
return __clc_fmax(x, y);
6164
#else
65+
(void)x;
66+
(void)y;
6267
throw runtime_error("bf16 is not supported on host device.",
6368
PI_INVALID_DEVICE);
6469
#endif
@@ -68,6 +73,9 @@ std::enable_if_t<detail::is_bf16_storage_type<T>::value, T> fma(T x, T y, T z) {
6873
#ifdef __SYCL_DEVICE_ONLY__
6974
return __clc_fma(x, y, z);
7075
#else
76+
(void)x;
77+
(void)y;
78+
(void)z;
7179
throw runtime_error("bf16 is not supported on host device.",
7280
PI_INVALID_DEVICE);
7381
#endif

0 commit comments

Comments
 (0)