Skip to content

Commit

Permalink
gemm: Correct BIST check
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Nov 22, 2023
1 parent 95e4b5b commit 24f68d9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sw/blas/gemm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ int main() {
snrt_dma_wait_all();
}

snrt_cluster_hw_barrier();

// TODO: currently only works for single cluster otherwise need to
// synchronize all cores here
#ifdef BIST
Expand All @@ -86,16 +88,16 @@ int main() {
uint32_t idx = m * N + n;
switch (dtype_size) {
case FP64:
if (fabs(result[idx] - ((double *)local_c)[idx]) >
if (fabs(result[idx] - ((double *)local_c)[idx]) <
0.001)
errors--;
break;
case FP32:
if (fabs(result[idx] - ((float *)local_c)[idx]) > 0.001)
if (fabs(result[idx] - ((float *)local_c)[idx]) < 0.001)
errors--;
break;
case FP16:
if (fabs(result[idx] - ((__fp16 *)local_c)[idx]) >
if (fabs(result[idx] - ((__fp16 *)local_c)[idx]) <
0.001)
errors--;
break;
Expand Down

0 comments on commit 24f68d9

Please sign in to comment.