[Openmp-commits] [openmp] [OpenMP][OMPT] Add missing callbacks for asynchronous target tasks (PR #93472)
Jan André Reuter via Openmp-commits
openmp-commits at lists.llvm.org
Mon May 27 07:32:47 PDT 2024
Thyre wrote:
Looking at the same example with tasking, we see the following:
```c
int main(void)
{
#pragma omp target nowait
{
for(int i = 0; i < 1000; ++i)
{}
}
// Do some stuff
#pragma omp taskwait
return 0;
}
```
```console
$ clang -fopenmp --offload-arch=gfx1101
$ ./a.out
[...]
[task_create_cb] tid = 1 | encountering_task_data = 6660001 | new_task_data = 6660011 | flags = target_untied | has_dependences = 0 | codeptr_ra = 0x5e6fb1dc428c
[...]
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[...]
[target_emi_cb] tid = 6 | endpoint = begin | kind = target | device_num = 0 | task_data = 6660011 | target_task_data = 0 | target_data = 0 | codeptr_ra = 0x5e6fb1dc43e1
[target_submit_emi_cb] tid = 6 | endpoint = begin
[target_submit_emi_cb] tid = 6 | endpoint = end
[target_emi_cb] tid = 6 | endpoint = end | kind = target | device_num = 0 | task_data = 6660011 | target_task_data = 0 | target_data = 0 | codeptr_ra = 0x5e6fb1dc43e1
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = switch | next_task_data = 6660007
[task_schedule_cb] tid = 6 | prior_task_data = 6660007 | prior_status = switch | next_task_data = 6660011
[task_schedule_cb] tid = 6 | prior_task_data = 6660011 | prior_status = complete | next_task_data = 6660007
[...]
[device_finalize_cb] tid = 1
```
This event sequence shows that the task create now uses `target` and that the `task switch` events are now fixed as well. I'm curious though: Why do we see so many switch events?
https://github.com/llvm/llvm-project/pull/93472
More information about the Openmp-commits
mailing list