[Openmp-commits] [PATCH] D92352: Add strict mode in num_tasks and grainsize

Nawrin Sultana via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 30 16:05:15 PST 2020


Nawrin created this revision.
Nawrin added reviewers: AndreyChurbanov, tlwilmar.
Nawrin added a project: OpenMP.
Herald added a subscriber: jfb.
Nawrin requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

This patch adds new API __kmpc_taskloop_5 to incorporate strict modifier in num_tasks and grainsize clause. In num_tasks with strict, the logical iterations are partitioned in balanced manner and is assigned in order to a generated task. In grainsize with strict, the number of logical iterations assigned to each task is equal to the value of grainsize, except for the task that contains the last iteration, which may have fewer iterations.

For example -

#pragma omp taskloop grainsize(strict:4)
for (i = 0; i < 22; i++)

This will create 6 tasks (4, 4, 4, 4, 4, 2)

#pragma omp taskloop num_tasks(strict:5)
for (i = 0; i < 22; i++)

This will create 5 tasks (5, 5, 4, 4, 4)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92352

Files:
  openmp/runtime/src/dllexports
  openmp/runtime/src/kmp.h
  openmp/runtime/src/kmp_tasking.cpp
  openmp/runtime/test/tasking/kmp_taskloop_5.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92352.308493.patch
Type: text/x-patch
Size: 22798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20201201/4b4e4ce1/attachment-0001.bin>


More information about the Openmp-commits mailing list