Skip to content

Commit 3df503c

Browse files
authored
portability fix and cleanup
1 parent 39c90f9 commit 3df503c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/compare_sgemv_bgemv.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
100100
SGEMV(&transA, &x, &x, &alpha, A, &x, B, &k, &beta, C, &k);
101101
BGEMV(&transA, &x, &x, &alpha_bf16, AA, &x, BB, &k, &beta_bf16, CC, &k);
102102

103-
for (int i = 0; i < x; i++)
103+
for (i = 0; i < x; i++)
104104
DD[i] *= beta;
105105

106106
for (j = 0; j < x; j++)
@@ -118,14 +118,18 @@ int main(int argc, char *argv[])
118118
{
119119
if (!is_close(float16to32(CC[j << l]), truncate_float32_to_bfloat16(C[j << l]), 0.01, 0.001))
120120
{
121-
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%d: CC=%.6f, C=%.6f\n",
121+
#ifdef DEBUG
122+
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%ld: CC=%.6f, C=%.6f\n",
122123
transA, alpha, beta, i, j, k, float16to32(CC[j << l]), truncate_float32_to_bfloat16(C[j << l]));
124+
#endif
123125
ret++;
124126
}
125127
if (!is_close(float16to32(CC[j << l]), truncate_float32_to_bfloat16(DD[j]), 0.001, 0.0001))
126128
{
127-
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%d: CC=%.6f, C=%.6f\n",
129+
#ifdef DEBUG
130+
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%ld: CC=%.6f, C=%.6f\n",
128131
transA, alpha, beta, i, j, k, float16to32(CC[j << l]), truncate_float32_to_bfloat16(DD[j]));
132+
#endif
129133
ret++;
130134
}
131135
}

0 commit comments

Comments
 (0)