Skip to content

Commit

Permalink
Fix rand_generate
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreySokolovSC committed Jan 18, 2024
1 parent bf39c0d commit c99e231
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions utest/test_extensions/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ void srand_generate(float *alpha, blasint n)
{
blasint i;
for (i = 0; i < n; i++)
alpha[i] = (float)rand() / (float)RAND_MAX * 5.0f;
alpha[i] = (float)rand() / (float)RAND_MAX;
}

void drand_generate(double *alpha, blasint n)
{
blasint i;
for (i = 0; i < n; i++)
alpha[i] = (double)rand() / (double)RAND_MAX * 5.0;
alpha[i] = (double)rand() / (double)RAND_MAX;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions utest/test_extensions/test_zgeadd.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ static double check_zgeadd(char api, OPENBLAS_CONST enum CBLAS_ORDER order,
}

// Fill matrix A, C
srand_generate(data_zgeadd.a_test, lda * rows * 2);
srand_generate(data_zgeadd.c_test, ldc * rows * 2);
drand_generate(data_zgeadd.a_test, lda * rows * 2);
drand_generate(data_zgeadd.c_test, ldc * rows * 2);

// Copy matrix C for zgeadd
for (i = 0; i < ldc * rows * 2; i++)
Expand Down
4 changes: 2 additions & 2 deletions utest/test_extensions/test_ztrmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ static double check_ztrmv(char uplo, char trans, char diag, blasint n, blasint l
double alpha_conj[] = {1.0, 0.0};
char trans_verify = trans;

srand_generate(data_ztrmv.a_test, n * lda * 2);
srand_generate(data_ztrmv.x_test, n * incx * 2);
drand_generate(data_ztrmv.a_test, n * lda * 2);
drand_generate(data_ztrmv.x_test, n * incx * 2);

for (i = 0; i < n * lda * 2; i++)
data_ztrmv.a_verify[i] = data_ztrmv.a_test[i];
Expand Down
4 changes: 2 additions & 2 deletions utest/test_extensions/test_ztrsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ static double check_ztrsv(char uplo, char trans, char diag, blasint n, blasint l
double alpha_conj[] = {1.0, 0.0};
char trans_verify = trans;

srand_generate(data_ztrsv.a_test, n * lda * 2);
srand_generate(data_ztrsv.x_test, n * incx * 2);
drand_generate(data_ztrsv.a_test, n * lda * 2);
drand_generate(data_ztrsv.x_test, n * incx * 2);

for (i = 0; i < n * lda * 2; i++)
data_ztrsv.a_verify[i] = data_ztrsv.a_test[i];
Expand Down

0 comments on commit c99e231

Please sign in to comment.