Skip to content

Commit

Permalink
fix: implement Vec::round fallback for armv7
Browse files Browse the repository at this point in the history
  • Loading branch information
ebraraktas committed Feb 26, 2024
1 parent 42c6b96 commit ac99886
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cpu/vec_neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ namespace ctranslate2 {
}

static inline value_type round(value_type v) {
#ifdef __aarch64__
return vrndiq_f32(v);
#else
float temp[4] = {std::nearbyintf(v[0]), std::nearbyintf(v[1]), std::nearbyintf(v[2]), std::nearbyintf(v[3])};
return load(temp);
#endif
}

static inline void convert_and_store(value_type v, int8_t *a, dim_t count) {
Expand Down

0 comments on commit ac99886

Please sign in to comment.