Skip to content

Commit

Permalink
halide_type_of<>() should always be constexpr (halide#6790)
Browse files Browse the repository at this point in the history
The ones in HalideRuntime.h have been marked constexpr for a while, but the ones in Float16.h got missed
  • Loading branch information
steven-johnson authored and ardier committed Mar 3, 2024
1 parent 5737c67 commit 2f8fdd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Float16.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static_assert(sizeof(float16_t) == 2, "float16_t should occupy two bytes");
} // namespace Halide

template<>
HALIDE_ALWAYS_INLINE halide_type_t halide_type_of<Halide::float16_t>() {
HALIDE_ALWAYS_INLINE constexpr halide_type_t halide_type_of<Halide::float16_t>() {
return halide_type_t(halide_type_float, 16);
}

Expand Down Expand Up @@ -254,7 +254,7 @@ static_assert(sizeof(bfloat16_t) == 2, "bfloat16_t should occupy two bytes");
} // namespace Halide

template<>
HALIDE_ALWAYS_INLINE halide_type_t halide_type_of<Halide::bfloat16_t>() {
HALIDE_ALWAYS_INLINE constexpr halide_type_t halide_type_of<Halide::bfloat16_t>() {
return halide_type_t(halide_type_bfloat, 16);
}

Expand Down

0 comments on commit 2f8fdd1

Please sign in to comment.