Skip to content

Commit 520e0bc

Browse files
authored
fix missing if constexpr in optimized gelu (unbreak sync of D68745515/#7987) (#8011)
The code gated under this `if` does disallowed `static_cast`s if the `if` condition doesn't pass; this is what `if constexpr` is for.
1 parent 2307b6f commit 520e0bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernels/optimized/cpu/op_gelu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void gelu(
6969
}
7070
#else
7171
size_t i = 0;
72-
if (std::is_same<CTYPE, float>::value) {
72+
if constexpr (std::is_same_v<CTYPE, float>) {
7373
for (; i + 4 < lim; i += 4) {
7474
const float32x4_t in =
7575
vld1q_f32(static_cast<const float*>(&in_data[i]));

0 commit comments

Comments
 (0)