[Openmp-commits] [PATCH] D147169: [OpenMP][libomptarget][NFC] Make all addition operations matter in private mapping test
Gheorghe-Teodor Bercea via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Mar 29 09:37:37 PDT 2023
doru1004 created this revision.
doru1004 added reviewers: jdoerfert, tianshilei1992, ronl, jhuber6.
doru1004 added a project: OpenMP.
Herald added subscribers: sunshaoce, guansong, yaxunl.
Herald added a project: All.
doru1004 requested review of this revision.
Herald added subscribers: openmp-commits, jplehr, sstefan1.
The test continues to intermittently fail and this is meant to make all addition operations in this test matter to the final result.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147169
Files:
openmp/libomptarget/test/mapping/private_mapping.c
Index: openmp/libomptarget/test/mapping/private_mapping.c
===================================================================
--- openmp/libomptarget/test/mapping/private_mapping.c
+++ 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 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 @@
break;
}
}
+ fflush(stdout);
assert(correct);
printf("PASS\n");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147169.509400.patch
Type: text/x-patch
Size: 1060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230329/85becb16/attachment.bin>
More information about the Openmp-commits
mailing list