Files
clang-p2996/openmp/libomptarget/test/offloading/target_nowait_target.cpp
Shilei Tian 458db51c10 [OpenMP] Add missing tt_hidden_helper_task_encountered along with tt_found_proxy_tasks
In most cases, hidden helper task behave similar as detached tasks. That means,
for example, if we have to wait for detached tasks, we have to do the same thing
for hidden helper tasks as well. This patch adds the missing condition for hidden
helper task accordingly along with detached task.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D107316
2021-12-29 23:22:53 -05:00

32 lines
572 B
C++

// RUN: %libomptarget-compilexx-and-run-generic
// UNSUPPORTED: amdgcn-amd-amdhsa
#include <cassert>
int main(int argc, char *argv[]) {
int data[1024];
int sum = 0;
for (int i = 0; i < 1024; ++i)
data[i] = i;
#pragma omp target map(tofrom: sum) map(to: data) depend(inout : data[0]) nowait
{
for (int i = 0; i < 1024; ++i) {
sum += data[i];
}
}
#pragma omp target map(tofrom: sum) map(to: data) depend(inout : data[0])
{
for (int i = 0; i < 1024; ++i) {
sum += data[i];
}
}
assert(sum == 1023 * 1024);
return 0;
}