Skip to content

Commit b5ad84c

Browse files
committed
Improve static assert message.
1 parent 4e2a9cf commit b5ad84c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sycl/include/sycl/ext/oneapi/bfloat16.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ __devicelib_ConvertBF16ToFINTELVec16(const uint16_t *, float *) noexcept;
235235
template <int N>
236236
inline void BF16VecToFloatVec(const bfloat16 src[N], float dst[N]) {
237237
static_assert(N == 1 || N == 2 || N == 3 || N == 4 || N == 8 || N == 16,
238-
"Unsupported vector size");
238+
"Unsupported vector size for bfloat16 conversion");
239239
#if defined(__SYCL_DEVICE_ONLY__) && (defined(__SPIR__) || defined(__SPIRV__))
240240
const uint16_t *src_i16 = sycl::bit_cast<const uint16_t *>(src);
241241
if constexpr (N == 1)
@@ -593,7 +593,8 @@ inline bfloat16 getBfloat16WithRoundingMode(const Ty &a) {
593593
return getBFloat16FromSIntegralWithRoundingMode<Ty>(a, roundingMode);
594594
} else {
595595
static_assert(std::is_integral_v<Ty> || std::is_floating_point_v<Ty>,
596-
"Only integral and floating point types are supported.");
596+
"Only integral and floating-point types are supported for "
597+
"conversion to bfloat16.");
597598
}
598599
}
599600
} // namespace ConvertToBfloat16

0 commit comments

Comments
 (0)