[Openmp-commits] [openmp] [OpenMP][Fix] Fix test array initialization. (PR #74799)

Gheorghe-Teodor Bercea via Openmp-commits openmp-commits at lists.llvm.org
Thu Dec 7 18:48:41 PST 2023


https://github.com/doru1004 created https://github.com/llvm/llvm-project/pull/74799

Fix test array initialization.

>From 50ba5b35e2e030376a4966964b90c618adda6122 Mon Sep 17 00:00:00 2001
From: Doru Bercea <doru.bercea at amd.com>
Date: Thu, 7 Dec 2023 21:44:07 -0500
Subject: [PATCH] Fix test array initialization.

---
 openmp/libomptarget/test/offloading/back2back_distribute.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/openmp/libomptarget/test/offloading/back2back_distribute.c b/openmp/libomptarget/test/offloading/back2back_distribute.c
index 750e39061974a..30cdd69776396 100644
--- a/openmp/libomptarget/test/offloading/back2back_distribute.c
+++ b/openmp/libomptarget/test/offloading/back2back_distribute.c
@@ -22,6 +22,10 @@ int main(int argc, char *argv[]) {
   double * b = (double *) malloc(MAX_N * sizeof(double));
   double * c = (double *) malloc(MAX_N * sizeof(double));
 
+  for (int i = 0; i < MAX_N; i++) {
+    d[i] = d_h[i] = a_h[i] = 0.0;
+  }
+
 #pragma omp target enter data map(to:a[:MAX_N],b[:MAX_N],c[:MAX_N],d[:MAX_N])
 
   for (int n = 32 ; n < MAX_N ; n+=5000) {



More information about the Openmp-commits mailing list