正在加载图片...
Page2 OpenMP API5.0 Directives and Constructs (continued) distribute loop constructs scan directive puteeeeautedbyheinitalteam Somp end distribute tonic:Ch s are assigned to thread e be se (n) ienerdhenheloenotd chu distribute simd 】 currently using s: SIMD directives stribute simd [clouse[[lciouse].] octorsnmd, simd stnbute simd &m by distribute or sime Distribute Parallel Worksharing-Loop Tasking constructs task ateenegtl.simdenength task constr apply pr8miopntdou5dL Somp distribute parallel do /oouse!clouse]... on-identfer:st) end (dep Distribute Parallel Worksharing-Loop SIMD Worksharing-Loop SIMD 2 IM cnophtcanhectdwta tribute parallel do simd cousef/clouse).. sion) e6a eclare simd loop construct will be eet pragm ncetondetinaoncrdedbroto Somp dedare simd fproc-nomel![clouse!L,Jdouse). nd loop nel n(argument-list) t e ecto8ut./econltenha:时 if (tas (tas (priv for final 20190 penMP ARB OMP0519-01-OMPS Page 2 OpenMP API 5.0 © 2019 OpenMP ARB OMP0519-01-OMP5 Directives and Constructs (continued) • auto: The decision regarding scheduling is delegated to the compiler and/or runtime system. • runtime: The schedule and chunk size are taken from the run-sched-var ICV. modifier: • monotonic: Each thread executes the chunks that it is assigned in increasing logical iteration order. Default for static schedule. • nonmonotonic: Chunks are assigned to threads in any order and the behavior of an application that depends on execution order of the chunks is unspecified. Default for all schedule kinds except static. • simd: Ignored when the loop is not associated with a SIMD construct, otherwise the new_chunk_size for all except the first and last chunks is chunk_size/ simd_width * simd_width where simd_width is an implementation-defined value. SIMD directives simd [2.9.3.1] [2.8.1] Applied to a loop to indicate that the loop can be transformed into a SIMD loop. C/C++#pragma omp simd [clause[ [, ]clause] ...] for-loops For!$omp simd [clause[ [, ]clause] ...] do-loops [!$omp end simd] clause: safelen (length), simdlen (length) linear (list[ : linear-step]) aligned (list[ : alignment]) nontemporal (list) private (list) lastprivate ([lastprivate-modifier : ] list) reduction ([ reduction-modifier, ] reduction-identifier : list) collapse (n) order (concurrent) C/C++ if ([simd :] scalar-expression) For if ([simd :] scalar-logical-expression) Worksharing-Loop SIMD [2.9.3.2] [2.8.3] Applied to a loop to indicate that the loop can be transformed into a SIMD loop that will be executed in parallel by threads in the team. C/C++#pragma omp for simd [clause[ [, ]clause] ...] for-loops For!$omp do simd [clause[ [, ]clause] ...] do-loops [!$omp end do simd[nowait] ] clause: Any of the clauses accepted by the simd or for/do directives with identical meanings and restrictions. declare simd [2.9.3.3] [2.8.2] Applied to a function or a subroutine to enable the creation of one or more versions that can process multiple arguments using SIMD instructions from a single invocation in a SIMD loop. C/C++ #pragma omp declare simd [clause[ [, ]clause] ...] [#pragma omp declare simd [clause[ [, ]clause] ...]] [...] function definition or declaration For !$omp declare simd [(proc-name)] [clause[ [, ]clause] ...] clause: simdlen (length) linear (linear-list[ : linear-step]) aligned (argument-list[ : alignment]) uniform (argument-list) inbranch notinbranch distribute loop constructs distribute [2.9.4.1] [2.10.8] Specifies loops which are executed by the initial teams. C/C++#pragma omp distribute [clause[ [, ]clause] ...] for-loops For!$omp distribute [clause[ [, ]clause] ...] do-loops [!$omp end distribute] clause: private (list) firstprivate (list) lastprivate (list) collapse (n) dist_schedule (kind[, chunk_size]) allocate ([allocator : ]list) distribute simd [2.9.4.2] [2.10.9] Specifies loops which are executed concurrently using SIMD instructions and the initial teams. C/C++#pragma omp distribute simd [clause[ [, ]clause] ...] for-loops For!$omp distribute simd [clause[ [, ]clause] ...] do-loops [!$omp end distribute simd] clause: Any of the clauses accepted by distribute or simd. Distribute Parallel Worksharing-Loop [2.9.4.3] [2.10.10] These constructs specify a loop that can be executed in parallel by multiple threads that are members of multiple teams. C/C++#pragma omp distribute parallel for [clause[ [, ]clause] ...] for-loops For!$omp distribute parallel do [clause[ [, ]clause] ...] do-loops [!$omp end distribute parallel do] clause: Any accepted by the distribute or parallel worksharing-loop directives with identical meanings and restrictions. Distribute Parallel Worksharing-Loop SIMD [2.9.4.4] [2.10.11] Specifies a loop that can be executed concurrently using SIMD instructions in parallel by multiple threads that are members of multiple teams. C/C++#pragma omp distribute parallel for simd \ [clause[ [ , ]clause] ...] for-loops For!$omp distribute parallel do simd [clause[ [, ]clause] ...] do-loops [!$omp end distribute parallel do simd] clause: Any accepted by the distribute or parallel worksharing-loop SIMD directives with identical meanings and restrictions. loop construct loop [2.9.5] Specifies that the iterations of the associated loops may execute concurrently and permits the encountering thread(s) to execute the loop accordingly. C/C++#pragma omp loop [clause[ [, ]clause] ...] for-loops For!$omp loop [clause[ [, ]clause] ...] do-loops [!$omp end loop ] clause: bind (binding) collapse (n) order (concurrent) private (list) lastprivate (list) reduction ([default ,]reduction-identifier : list) binding: teams, parallel, thread scan directive scan [2.9.6] Specifies that each iteration of scan computations update the list items. C/C++ loop-associated-directive for-loop-headers { structured-block #pragma omp scan clause structured-block } For loop-associated-directive do-loop-headers structured-block !$omp scan clause structured-block do-termination-stmts(s) [end-loop-associated-directive ] clause: inclusive (list), exclusive (list) loop-associated-directive directives: C/C++ for, for simd, simd [end-]loop-associated-directive directives: For do (end do) do simd (end do simd) simd (end simd) Tasking constructs task [2.10.1] [2.9.1] Defines an explicit task. The data environment of the task is created according to the data-sharing attribute clauses on the task construct and any defaults that apply. C/C++#pragma omp task [clause[ [, ]clause] ...] structured-block For!$omp task [clause[ [, ]clause] ...] structured-block !$omp end task clause: untied, mergeable private (list), firstprivate (list), shared (list) in_reduction (reduction-identifier: list) depend ([depend-modifier, ] dependence-type : locator-list) priority(priority-value) allocate([allocator: ]list) affinity ([aff-modifier: ] locator-list) - where aff-modifier is iterator(iterators-definition) detach (event-handle) - where event-handle is of: type omp_event_handle_t C/C++ kind omp_event_handle_kind For C/C++ default (shared | none) C/C++ if ([ task : ] scalar-expression) C/C++ final (scalar-expression) For default (private | firstprivate | shared | none) For if ([ task : ] scalar-logical-expression) For final (scalar-logical-expression) taskloop [2.10.2] [2.9.2] Specifies that the iterations of one or more associated loops will be executed in parallel using OpenMP tasks. C/C++#pragma omp taskloop [clause[ [, ]clause] ...] for-loops For!$omp taskloop [clause[ [, ]clause] ...] do-loops [!$omp end taskloop ] clause: shared (list), private (list) firstprivate (list), lastprivate (list) reduction ([default ,] reduction-identifier : list) in_reduction (reduction-identifier : list) grainsize (grain-size), num_tasks (num-tasks) collapse (n), priority (priority-value) untied, mergeable, nogroup allocate ([allocator: ]list) C/C++ if ([ taskloop : ] scalar-expression) C/C++ default (shared | none) C/C++ final (scalar-expr) For if ([ taskloop : ] scalar-logical-expression) For default (private | firstprivate | shared | none) For final (scalar-logical-expr) Continued4
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有