Skip to content

Commit d92f151

Browse files
authored
Merge pull request #5386 from martin-frbg/issue5384
Fixes for some gcc warnings
2 parents 39c90f9 + 30dbca5 commit d92f151

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

interface/lapack/trtri.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ int NAME(char *UPLO, char *DIAG, blasint *N, FLOAT *a, blasint *ldA, blasint *In
127127
#endif
128128

129129
#ifdef SMP
130-
if (args.n <= 150)
131-
args.nthreads = 1;
132-
else
133-
args.nthreads = num_cpu_avail(4);
130+
if (args.n <= 150)
131+
args.nthreads = 1;
132+
else
133+
args.nthreads = num_cpu_avail(4);
134134

135135
if (args.nthreads == 1) {
136136
#endif

test/compare_sgemm_bgemm.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,18 @@ main (int argc, char *argv[])
125125
float16to32 (AA[k * j + l]) * float16to32 (BB[i + l * n]);
126126
}
127127
if (!is_close(float16to32(CC[i * m + j]), truncate_float32_to_bfloat16(C[i * m + j]), 0.01, 0.001)) {
128-
printf("Mismatch at i=%d, j=%d, k=%d: CC=%.6f, C=%.6f\n",
128+
#ifdef DEBUG
129+
printf("Mismatch at i=%d, j=%d, k=%ld: CC=%.6f, C=%.6f\n",
129130
i, j, k, float16to32(CC[i * m + j]), truncate_float32_to_bfloat16(C[i * m + j]));
131+
#endif
130132
ret++;
131133
}
132134

133135
if (!is_close(float16to32(CC[i * m + j]), truncate_float32_to_bfloat16(DD[i * m + j]), 0.0001, 0.00001)) {
134-
printf("Mismatch at i=%d, j=%d, k=%d: CC=%.6f, DD=%.6f\n",
136+
#ifdef DEBUG
137+
printf("Mismatch at i=%d, j=%d, k=%ld: CC=%.6f, DD=%.6f\n",
135138
i, j, k, float16to32(CC[i * m + j]), truncate_float32_to_bfloat16(DD[i * m + j]));
139+
#endif
136140
ret++;
137141
}
138142

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)