aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGheorghe-Teodor Bercea <doru.bercea@amd.com>2023-12-07 22:09:08 -0500
committerGitHub <noreply@github.com>2023-12-07 22:09:08 -0500
commitd41368134478d1d41726aa85ba82f49b5bce130c (patch)
tree75eb12f673077114f39d5775f72e1b40118cda86
parent8275dc97483347b88a2fa9067446dfb9d7d7f72e (diff)
downloadllvm-d41368134478d1d41726aa85ba82f49b5bce130c.zip
llvm-d41368134478d1d41726aa85ba82f49b5bce130c.tar.gz
llvm-d41368134478d1d41726aa85ba82f49b5bce130c.tar.bz2
[OpenMP][Fix] Fix test array initialization. (#74799)
Fix test array initialization.
-rw-r--r--openmp/libomptarget/test/offloading/back2back_distribute.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openmp/libomptarget/test/offloading/back2back_distribute.c b/openmp/libomptarget/test/offloading/back2back_distribute.c
index 750e390..4910d41 100644
--- a/openmp/libomptarget/test/offloading/back2back_distribute.c
+++ b/openmp/libomptarget/test/offloading/back2back_distribute.c
@@ -15,12 +15,12 @@ void reset_input(double *a, double *a_h, double *b, double *c) {
}
int main(int argc, char *argv[]) {
- double * a = (double *) malloc(MAX_N * sizeof(double));
- double * a_h = (double *) malloc(MAX_N * sizeof(double));
- double * d = (double *) malloc(MAX_N * sizeof(double));
- double * d_h = (double *) malloc(MAX_N * sizeof(double));
- double * b = (double *) malloc(MAX_N * sizeof(double));
- double * c = (double *) malloc(MAX_N * sizeof(double));
+ double *a = (double *)calloc(MAX_N * sizeof(double));
+ double *a_h = (double *)calloc(MAX_N * sizeof(double));
+ double *d = (double *)calloc(MAX_N * sizeof(double));
+ double *d_h = (double *)calloc(MAX_N * sizeof(double));
+ double *b = (double *)calloc(MAX_N * sizeof(double));
+ double *c = (double *)calloc(MAX_N * sizeof(double));
#pragma omp target enter data map(to:a[:MAX_N],b[:MAX_N],c[:MAX_N],d[:MAX_N])