Improve checking on reduction_shared_array
#define ITERS 4096
int main() {
- #pragma omp target
+ int failed = 0;
+ #pragma omp target map(tofrom: failed)
{
int globalized[256];
@@ -16,13 +17,16 @@ int main() {
for (int i = 0; i < ITERS; i++) {
globalized[i % 256] += i;
}
-
printf("%d", globalized[0]);
for (int i = 1; i < 256; i++) {
printf(" %d", globalized[i]);
+ if (globalized[i] != (30720 + i*16))
+ failed = 1;
}
printf("\n");
+ if (failed) printf("Failed\n");
+ else printf("Passed\n");
}
- return 0;
+ return failed;
}
