Browse Source

Merge pull request #5386 from martin-frbg/issue5384

Fixes for some gcc warnings
pull/5318/head
Martin Kroeker GitHub 2 months ago
parent
commit
d92f151634
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 9 deletions
  1. +4
    -4
      interface/lapack/trtri.c
  2. +6
    -2
      test/compare_sgemm_bgemm.c
  3. +7
    -3
      test/compare_sgemv_bgemv.c

+ 4
- 4
interface/lapack/trtri.c View File

@@ -127,10 +127,10 @@ int NAME(char *UPLO, char *DIAG, blasint *N, FLOAT *a, blasint *ldA, blasint *In
#endif

#ifdef SMP
if (args.n <= 150)
args.nthreads = 1;
else
args.nthreads = num_cpu_avail(4);
if (args.n <= 150)
args.nthreads = 1;
else
args.nthreads = num_cpu_avail(4);

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


+ 6
- 2
test/compare_sgemm_bgemm.c View File

@@ -125,14 +125,18 @@ main (int argc, char *argv[])
float16to32 (AA[k * j + l]) * float16to32 (BB[i + l * n]);
}
if (!is_close(float16to32(CC[i * m + j]), truncate_float32_to_bfloat16(C[i * m + j]), 0.01, 0.001)) {
printf("Mismatch at i=%d, j=%d, k=%d: CC=%.6f, C=%.6f\n",
#ifdef DEBUG
printf("Mismatch at i=%d, j=%d, k=%ld: CC=%.6f, C=%.6f\n",
i, j, k, float16to32(CC[i * m + j]), truncate_float32_to_bfloat16(C[i * m + j]));
#endif
ret++;
}

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


+ 7
- 3
test/compare_sgemv_bgemv.c View File

@@ -100,7 +100,7 @@ int main(int argc, char *argv[])
SGEMV(&transA, &x, &x, &alpha, A, &x, B, &k, &beta, C, &k);
BGEMV(&transA, &x, &x, &alpha_bf16, AA, &x, BB, &k, &beta_bf16, CC, &k);

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

for (j = 0; j < x; j++)
@@ -118,14 +118,18 @@ int main(int argc, char *argv[])
{
if (!is_close(float16to32(CC[j << l]), truncate_float32_to_bfloat16(C[j << l]), 0.01, 0.001))
{
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%d: CC=%.6f, C=%.6f\n",
#ifdef DEBUG
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%ld: CC=%.6f, C=%.6f\n",
transA, alpha, beta, i, j, k, float16to32(CC[j << l]), truncate_float32_to_bfloat16(C[j << l]));
#endif
ret++;
}
if (!is_close(float16to32(CC[j << l]), truncate_float32_to_bfloat16(DD[j]), 0.001, 0.0001))
{
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%d: CC=%.6f, C=%.6f\n",
#ifdef DEBUG
printf("Mismatch at trans=%c, alpha=%.2f, beta=%.2f, i=%d, j=%d, k=%ld: CC=%.6f, C=%.6f\n",
transA, alpha, beta, i, j, k, float16to32(CC[j << l]), truncate_float32_to_bfloat16(DD[j]));
#endif
ret++;
}
}


Loading…
Cancel
Save