Skip to content

Commit

Permalink
Enable fp16 for risc-v
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 634141528
  • Loading branch information
fbarchard authored and xnnpack-bot committed May 16, 2024
1 parent 8d5f4e0 commit 30080c2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/configs/hardware-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ static void init_hardware_config(void) {
__asm__(".word 0xC22022F3" /* CSRR t0, vlenb */ : "=r" (vlenb));
hardware_config.vlenb = vlenb;
xnn_log_info("RISC-V VLENB: %" PRIu32, vlenb);

// Assume a uarch with long vectors supports fp16 as well
if (vlenb >= 64) {
hardware_config.use_riscv_vector_fp16_arith = true;
}
}
#endif

Expand Down

0 comments on commit 30080c2

Please sign in to comment.