[all-commits] [llvm/llvm-project] ea4523: [OpenMP] Refined the logic to give a regular task ...

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Jul 22 16:21:43 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ea452353c013b95dbe9d64ff59a97597b2549f19
      https://github.com/llvm/llvm-project/commit/ea452353c013b95dbe9d64ff59a97597b2549f19
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M openmp/runtime/src/kmp_taskdeps.h
    M openmp/runtime/src/kmp_tasking.cpp

  Log Message:
  -----------
  [OpenMP] Refined the logic to give a regular task from a hidden helper task

In current implementation, if a regular task depends on a hidden helper task,
and when the hidden helper task is releasing its dependences, it directly calls
`__kmp_omp_task`. This could cause a problem that if `__kmp_push_task` returns
`TASK_NOT_PUSHED`, the task will be executed immediately. However, the hidden
helper threads are assumed to only execute hidden helper tasks. This could cause
problems because when calling `__kmp_omp_task`, the encountering gtid, which is
not the real one of the thread, is passed.

This patch uses `__kmp_give_task`, but because it is a static function, a new
wrapper `__kmpc_give_task` is added.

Reviewed By: AndreyChurbanov

Differential Revision: https://reviews.llvm.org/D106572




More information about the All-commits mailing list