This change introduces the GOMP_taskwait_depend() function. It implements
the OpenMP 5.0 feature of #pragma omp taskwait with depend() clause by
wrapping around the __kmpc_omp_wait_deps() function.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The GOMP wrapper makes sense to me.
Several inline comments for the test.
openmp/runtime/test/tasking/omp50_taskwait_depend.c | ||
---|---|---|
15 | since this is an OpenMP program, shouldn't we use OpenMP atomic store and load? | |
26 | How can we be sure, that not all threads get occupied by these tasks, while none of the other tasks are scheduled? | |
51 | The test succeeds with clang, when I replace this line with #pragma omp task if(0) depend(inout: a) {} Can you please add this copy of the test? | |
60 | b should be loaded with omp atomic |
openmp/runtime/test/tasking/omp50_taskwait_depend.c | ||
---|---|---|
18 | I think the test is going to hang if executed by a single thread. So omp_get_max_threads() should be checked before parallel, and if it is 1 then omp_set_num_threads() could be used to increase number of threads explicitly. |
Test was poorly constructed. Second attempt.
The test is three steps:
- test a single independent task and make sure the #pragma omp taskwait depend() does not wait on that task. Also ensure that a worker thread grabs the task instead of the generating thread.
- test a single task with irrelevant dependencies and make sure the #pragma omp taskwait depend() does not wait on that task. Also ensure that a worker thread grabs the task instead of the generating thread.
- test a single dependent task which takes a while and make sure the #pragma omp taskwait depend() actually waits on it.
The test also forces at least two threads in the parallel region, and then rechecks to ensure that at least two threads were actually created for the parallel region.
The #pragma omp task if(0) depend() version of the test will be part of the GOMP fix if0 patch: D87271
openmp/runtime/test/tasking/omp50_taskwait_depend.c | ||
---|---|---|
3 | For the OMPT tests, I prefer to use XFAIL in the situations, where I expect compiler support at some point. This is what I have in the OMPT test case: // clang does not yet support taskwait with depend clause // clang-12 introduced parsing, but no codegen // update expected result when codegen in clang was added // XFAIL: clang |
For the OMPT tests, I prefer to use XFAIL in the situations, where I expect compiler support at some point.
This way, we won't forget to update the support level when codegen is added for clang/icc .
This is what I have in the OMPT test case: