Differential D62393 Diff 223845 libomptarget/deviceRTLs/nvptx/test/parallel/spmd_parallel_regions.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libomptarget/deviceRTLs/nvptx/test/parallel/spmd_parallel_regions.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | #pragma omp critical | ||||
// CHECK: Parallel level in SPMD mode: L1 is 1, L2 is 2 | // CHECK: Parallel level in SPMD mode: L1 is 1, L2 is 2 | ||||
printf("Parallel level in SPMD mode: L1 is %d, L2 is %d\n", ParallelLevel1, | printf("Parallel level in SPMD mode: L1 is %d, L2 is %d\n", ParallelLevel1, | ||||
ParallelLevel2); | ParallelLevel2); | ||||
// Final result of Count is (10-6)(num of loops)*10(num of iterations)*2(par | // Final result of Count is (10-6)(num of loops)*10(num of iterations)*2(par | ||||
// level) + 6(num of iterations) * 1(par level) | // level) + 6(num of iterations) * 1(par level) | ||||
// CHECK: Expected count = 86 | // CHECK: Expected count = 86 | ||||
printf("Expected count = %d\n", Count); | printf("Expected count = %d\n", Count); | ||||
Count = 0; | |||||
#pragma omp target parallel for reduction(+: Count) schedule(dynamic, 2) num_threads(64) | |||||
for (int J = 0; J < 1000; ++J) { | |||||
Count += J; | |||||
} | |||||
// 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); | |||||
return isHost; | return isHost; | ||||
} | } |