[Openmp-commits] [openmp] f2b15b9 - Make all additions matter in private mapping test.
Doru Bercea via Openmp-commits
openmp-commits at lists.llvm.org
Wed Mar 29 11:40:48 PDT 2023
Author: Doru Bercea
Date: 2023-03-29T14:40:40-04:00
New Revision: f2b15b9ed9c70f7f42cf2c134be15a5fed52d6c0
URL: https://github.com/llvm/llvm-project/commit/f2b15b9ed9c70f7f42cf2c134be15a5fed52d6c0
DIFF: https://github.com/llvm/llvm-project/commit/f2b15b9ed9c70f7f42cf2c134be15a5fed52d6c0.diff
LOG: Make all additions matter in private mapping test.
Added:
Modified:
openmp/libomptarget/test/mapping/private_mapping.c
Removed:
################################################################################
diff --git a/openmp/libomptarget/test/mapping/private_mapping.c b/openmp/libomptarget/test/mapping/private_mapping.c
index f537489cd08f4..a052b104bc864 100644
--- a/openmp/libomptarget/test/mapping/private_mapping.c
+++ b/openmp/libomptarget/test/mapping/private_mapping.c
@@ -4,8 +4,13 @@
#include <stdio.h>
int main() {
- int data1[3] = {1}, data2[3] = {2}, data3[3] = {5};
+ int data1[3] = {1, 2, 5};
+ int data2[3] = {10, 20, 50};
+ int data3[3] = {100, 200, 500};
int sum[16] = {0};
+
+ for (int i=0; i<16; i++) sum[i] = 10000;
+
#pragma omp target teams distribute parallel for map(tofrom : sum) \
firstprivate(data1, data2, data3)
for (int i = 0; i < 16; ++i) {
@@ -18,7 +23,7 @@ int main() {
int correct = 1;
for (int i = 0; i < 16; ++i) {
- if (sum[i] != 8) {
+ if (sum[i] != 10888) {
correct = 0;
printf("ERROR: The sum for index %d is %d\n", i, sum[i]);
printf("ERROR: data1 = {%d, %d, %d}\n", data1[0], data1[1], data1[2]);
@@ -27,6 +32,7 @@ int main() {
break;
}
}
+ fflush(stdout);
assert(correct);
printf("PASS\n");
More information about the Openmp-commits
mailing list