[Openmp-commits] [openmp] 5fc76e6 - [OpenMP][Fix] Fix test initialization (#74801)
via Openmp-commits
openmp-commits at lists.llvm.org
Thu Dec 7 19:20:36 PST 2023
Author: Gheorghe-Teodor Bercea
Date: 2023-12-07T22:20:32-05:00
New Revision: 5fc76e6b6da7986574596134d83872b460c332cc
URL: https://github.com/llvm/llvm-project/commit/5fc76e6b6da7986574596134d83872b460c332cc
DIFF: https://github.com/llvm/llvm-project/commit/5fc76e6b6da7986574596134d83872b460c332cc.diff
LOG: [OpenMP][Fix] Fix test initialization (#74801)
Fix test initialization
Added:
Modified:
openmp/libomptarget/test/offloading/back2back_distribute.c
Removed:
################################################################################
diff --git a/openmp/libomptarget/test/offloading/back2back_distribute.c b/openmp/libomptarget/test/offloading/back2back_distribute.c
index 750e39061974a3..63cabd0c66788b 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])
More information about the Openmp-commits
mailing list