Skip to content

Commit 4fdb8fd

Browse files
authored
Memory leak fix for gesv test code (flame#109)
Overflow test specific vector allocation brought under corresponding check to solve memory leak. AMD Internal: CPUPL-7352
1 parent e4dae10 commit 4fdb8fd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/main/src/test_gesv.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ void fla_test_gesv_experiment(char *tst_api, test_params_t *params, integer data
170170
create_matrix(datatype, LAPACK_COL_MAJOR, n, NRHS, &B, ldb);
171171
create_matrix(datatype, LAPACK_COL_MAJOR, n, NRHS, &B_save, ldb);
172172
create_realtype_vector(datatype, &s_test, n);
173-
create_vector(get_realtype(datatype), &scal, 1);
173+
if(FLA_OVERFLOW_UNDERFLOW_TEST)
174+
{
175+
create_vector(get_realtype(datatype), &scal, 1);
176+
}
174177

175178
/* This code path is run to generate the matrix to be passed to the API. This is the default
176179
* input generation logic accessed both when BRT is run in Ground truth mode and for non BRT
@@ -425,4 +428,4 @@ integer check_bit_reproducibility_gesv(void *filename, integer datatype, integer
425428

426429
fclose(gt_file);
427430
return 1;
428-
}
431+
}

0 commit comments

Comments
 (0)