Created
June 14, 2019 01:05
-
-
Save jdoerfert/d2b18ca8bb5c3443cc1d26b23236866f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
for (int i = 0; i < 1000; ++i) { | |
int Count = 0; | |
#pragma omp target parallel for reduction(+: Count) schedule(dynamic, 2) num_threads(64) | |
for (int J = 0; J < 1000; ++J) { | |
Count += J; | |
} | |
if (Count != 499500) | |
printf("ERROR [@%i] %i\n", i, Count); | |
} | |
// Final result of Count is 1000 * (999-0) / 2 | |
// CHECK: Expected count with dynamic scheduling = 499500 | |
// printf("Expected count with dynamic scheduling = %d\n", Count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment