Skip to content

Commit b104b30

Browse files
committed
Use std::ignore.
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
1 parent e46997b commit b104b30

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

sycl/include/sycl/ext/oneapi/experimental/builtins.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ std::enable_if_t<std::is_same<T, bfloat16>::value, T> fabs(T x) {
120120
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
121121
return bfloat16::from_bits(__clc_fabs(x.raw()));
122122
#else
123-
(void)x;
123+
std::ignore = x;
124124
throw runtime_error("bfloat16 is not currently supported on the host device.",
125125
PI_INVALID_DEVICE);
126126
#endif // defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
@@ -141,7 +141,7 @@ sycl::marray<bfloat16, N> fabs(sycl::marray<bfloat16, N> x) {
141141
}
142142
return res;
143143
#else
144-
(void)x;
144+
std::ignore = x;
145145
throw runtime_error("bfloat16 is not currently supported on the host device.",
146146
PI_INVALID_DEVICE);
147147
#endif // defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
@@ -152,7 +152,7 @@ std::enable_if_t<std::is_same<T, bfloat16>::value, T> fmin(T x, T y) {
152152
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
153153
return bfloat16::from_bits(__clc_fmin(x.raw(), y.raw()));
154154
#else
155-
(void)x;
155+
std::ignore = x;
156156
(void)y;
157157
throw runtime_error("bfloat16 is not currently supported on the host device.",
158158
PI_INVALID_DEVICE);
@@ -178,7 +178,7 @@ sycl::marray<bfloat16, N> fmin(sycl::marray<bfloat16, N> x,
178178

179179
return res;
180180
#else
181-
(void)x;
181+
std::ignore = x;
182182
(void)y;
183183
throw runtime_error("bfloat16 is not currently supported on the host device.",
184184
PI_INVALID_DEVICE);
@@ -190,7 +190,7 @@ std::enable_if_t<std::is_same<T, bfloat16>::value, T> fmax(T x, T y) {
190190
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
191191
return bfloat16::from_bits(__clc_fmax(x.raw(), y.raw()));
192192
#else
193-
(void)x;
193+
std::ignore = x;
194194
(void)y;
195195
throw runtime_error("bfloat16 is not currently supported on the host device.",
196196
PI_INVALID_DEVICE);
@@ -215,7 +215,7 @@ sycl::marray<bfloat16, N> fmax(sycl::marray<bfloat16, N> x,
215215
}
216216
return res;
217217
#else
218-
(void)x;
218+
std::ignore = x;
219219
(void)y;
220220
throw runtime_error("bfloat16 is not currently supported on the host device.",
221221
PI_INVALID_DEVICE);
@@ -227,7 +227,7 @@ std::enable_if_t<std::is_same<T, bfloat16>::value, T> fma(T x, T y, T z) {
227227
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
228228
return bfloat16::from_bits(__clc_fma(x.raw(), y.raw(), z.raw()));
229229
#else
230-
(void)x;
230+
std::ignore = x;
231231
(void)y;
232232
(void)z;
233233
throw runtime_error("bfloat16 is not currently supported on the host device.",
@@ -255,7 +255,7 @@ sycl::marray<bfloat16, N> fma(sycl::marray<bfloat16, N> x,
255255
}
256256
return res;
257257
#else
258-
(void)x;
258+
std::ignore = x;
259259
(void)y;
260260
throw runtime_error("bfloat16 is not currently supported on the host device.",
261261
PI_INVALID_DEVICE);

sycl/include/sycl/ext/oneapi/matrix/matrix-tensorcore.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ joint_matrix_fill(Group sg,
138138
const T2 v) {
139139
// We kept the unused "sg" in joint_matrix_fill to match the other DPC++
140140
// functions
141-
(void)sg;
141+
std::ignore = sg;
142142
#if defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
143143
res.wi_marray = v;
144144
#else
145-
(void)res;
146-
(void)v;
145+
std::ignore = res;
146+
std::ignore = v;
147147
#endif // defined(__SYCL_DEVICE_ONLY__) && defined(__NVPTX__)
148148
}
149149

@@ -652,10 +652,10 @@ void joint_matrix_load(
652652
Layout, Space>{}
653653
.load(res, src, stride);
654654
#else
655-
(void)sg;
656-
(void)res;
657-
(void)src;
658-
(void)stride;
655+
std::ignore = sg;
656+
std::ignore = res;
657+
std::ignore = src;
658+
std::ignore = stride;
659659
throw runtime_error(
660660
"When using SYCL_EXT_ONEAPI_MATRIX=3 joint_matrix_load is "
661661
"only supported by CUDA devices",
@@ -674,10 +674,10 @@ void joint_matrix_store(Group sg,
674674
Layout, Space>{}
675675
.store(src, dst, stride);
676676
#else
677-
(void)sg;
678-
(void)src;
679-
(void)dst;
680-
(void)stride;
677+
std::ignore = sg;
678+
std::ignore = src;
679+
std::ignore = dst;
680+
std::ignore = stride;
681681
throw runtime_error(
682682
"When using SYCL_EXT_ONEAPI_MATRIX=3 joint_matrix_store is "
683683
"only supported by CUDA devices",
@@ -698,10 +698,10 @@ joint_matrix_mad(
698698
T1, T2, M, K, N, LayoutA, LayoutB, LayoutC>{}
699699
.mad(A, B, C);
700700
#else
701-
(void)sg;
702-
(void)A;
703-
(void)B;
704-
(void)C;
701+
std::ignore = sg;
702+
std::ignore = A;
703+
std::ignore = B;
704+
std::ignore = C;
705705
throw runtime_error("When using SYCL_EXT_ONEAPI_MATRIX=3 joint_matrix_mad is "
706706
"only supported by CUDA devices",
707707
PI_INVALID_DEVICE);

0 commit comments

Comments
 (0)