正在加载图片...
OpenMP API5.0 Page5 Directives and Constructs (continued) Synchronization constructs other sta critical [2.1.1 1213.21 associated structured block to a inele thread at a time pagmaomprtcalhomelhtthteprespnl /ISomp end target teams distribute simd 5onmpengm hserCoateessoathatevalsisod Target Teams Loop2B2 d,write,update,capture der-clouse or hint (hint-expression) ssion-stm on-stmr #pragma omp barrier =pe cut for spe ct containing a no other stateme tpragma omp taskwait [clousel[I clouse]] of the followine form eependen-type omdisribue paraedo atrCwnsortpootcstotcmcmt D232211切 suctured-block eeeiawenshamg4opsMD arallel for simd u5h27周23 osofhevaniables naompflushmemryorder-causs tSomp fush memory-order-clouses master construct ory-order-clause:acq rel,release,or acquire erihrea制theesthgteaautedbythe ordered (m me6h omp end maste 2-pe& ]cause]- the first form):threads or simd Continued in columnn poreereependlsnk:ved 2019 OpenMP ARB OMP0519-01-OMP© 2019 OpenMP ARB OMP0519-01-OMP5 OpenMP API 5.0 Page 5 Directives and Constructs (continued) target teams distribute simd [2.13.23] [2.11.13] Shortcut for specifying a target construct containing a teams distribute simd construct and no other statements. C/C++#pragma omp target teams distribute simd \ [clause[ [, ]clause] ...] for-loops For!$omp target teams distribute simd [clause[ [, ]clause] ...] do-loops [!$omp end target teams distribute simd] clause: Any accepted by the target or teams distribute simd directives with identical meanings and restrictions. Target Teams Loop [2.13.24] Shortcut for specifying a target construct containing a teams loop construct and no other statements. C/C++#pragma omp target teams loop [clause[ [, ]clause] ...] for-loops For!$omp target teams loop [clause[ [, ]clause] ...] do-loops [!$omp end target teams loop] clause: Any clause used for target or teams loop directives with identical meanings and restrictions. Target Teams Distribute Parallel Worksharing-Loop [2.13.25] [2.11.15] Shortcut for specifying a target construct containing a teams distribute parallel worksharing-loop construct and no other statements. C/C++#pragma omp target teams distribute parallel for \ [clause[ [, ]clause] ...] for-loops For !$omp target teams distribute parallel do & [clause[ [, ]clause] ...] do-loops [$omp end target teams distribute parallel do] clause: Any clause used for target or teams distribute parallel for/do directives with identical meanings and restrictions. Target Teams Distribute Parallel Worksharing-Loop SIMD[2.13.26] [2.11.17] Shortcut for specifying a target construct containing a teams distribute parallel worksharing-loop SIMD construct and no other statements. C/C++#pragma omp target teams distribute parallel for simd \ [clause[ [, ]clause] ...] for-loops For !$omp target teams distribute parallel do simd & [clause[ [, ]clause] ...] do-loops [!$omp end target teams distribute parallel do simd] clause: Any clause used for target or teams distribute parallel for/do simd directives with identical meanings and restrictions. master construct master[2.16] [2.13.1] Specifies a structured block that is executed by the master thread of the team. C/C++#pragma omp master structured-block For!$omp master structured-block !$omp end master Synchronization constructs critical [2.17.1] [2.13.2] Restricts execution of the associated structured block to a single thread at a time. C/C++#pragma omp critical [(name) [[,] hint (hint-expression)]] structured-block For!$omp critical [(name) [[,] hint (hint-expression)] ] structured-block !$omp end critical [(name)] hint-expression: C/C++ An integer constant expression that evaluates to a valid synchronization hint hint-expression: For A constant expression that evaluates to a scalar value with kind omp_sync_hint_kind and a value that is a valid synchronization hint barrier[2.17.2] [2.13.3] Specifies an explicit barrier that prevents any thread in a team from continuing past the barrier until all threads in the team encounter the barrier. C/C++ #pragma omp barrier For !$omp barrier taskwait[2.17.5] [2.13.4] Specifies a wait on the completion of child tasks of the current task. C/C++ #pragma omp taskwait [clause[ [, ] clause] ...] For !$omp taskwait [clause[ [, ] clause] ...] clause: depend ([depend-modifier, ] dependence-type : locator-list) taskgroup [2.17.6] [2.13.5] Specifies a region which a task cannot leave until all its descendant tasks generated inside the dynamic scope of the region have completed C/C++#pragma omp taskgroup [clause[ [, ]clause] ...] structured-block For!$omp taskgroup [clause[ [, ]clause] ...] structured-block !$omp end taskgroup clause: task_reduction (reduction-identifier : list) allocate ([allocator: ]list) atomic [2.17.7] [2.13.6] Ensures a specific storage location is accessed atomically. May take one of the following seven forms: C/C++ #pragma omp atomic [clause[[[,] clause] ... ] [,]] \ atomic-clause [[,] clause [[[,] clause] ...]] expression-stmt #pragma omp atomic [clause[[,] clause] ...] expression-stmt #pragma omp atomic [clause[[[,] clause] ... ] [,]] capture \ [[,] clause [[[,] clause] ... ]] structured-block For !$omp atomic [clause[[[,] clause] ... ] [,]] read & [[,] clause [[[,] clause] ...]] capture-statement [!$omp end atomic] !$omp atomic [clause[[[,] clause] ... ] [,]] write & [[,] clause [[[,] clause] ...]] write-statement [!$omp end atomic] !$omp atomic [clause[[[,] clause] ... ] [,]] update & [[,] clause [[[,] clause] ...]] update-statement [!$omp end atomic] !$omp atomic [clause[[,] clause] ...] update-statement [!$omp end atomic] Continued in next column For !$omp atomic [clause[[[,] clause] ... ] [,]] capture & [[,] clause [[[,] clause] ...]] update-statement capture-statement !$omp end atomic !$omp atomic [clause[[[,] clause] ... ] [,]] capture & [[,] clause [[[,] clause] ...]] capture-statement update-statement !$omp end atomic !$omp atomic [clause[[[,] clause] ... ] [,]] capture & [[,] clause [[[,] clause] ...]] capture-statement write-statement !$omp end atomic atomic-clause: read, write, update, capture memory-order-clause: seq_cst, acq_rel, release, acquire, relaxed clause: memory-order-clause or hint (hint-expression) C/C++ expression-stmt: if atomic clause is... expression-stmt: read v = x; write x = expr; update or is not present x++; x--; ++x; --x; x binop= expr; x = x binop expr; x = expr binop x; capture v=x++; v=x--; v=++x; v= --x; v=x binop= expr; v=x = x binop expr; v=x = expr binop x; C/C++ structured-block may be one of the following forms: {v = x; x binop= expr;} {x binop= expr; v = x;} {v = x; x = x binop expr;} {v = x; x = expr binop x;} {x = x binop expr; v = x;} {x = expr binop x; v = x;} {v = x; x = expr;} {v = x; x++;} {v = x; ++x;} {++x; v = x;} {x++; v = x;} {v = x; x--;} {v = x; --x;} {--x; v = x;} {x--; v = x;} For capture-, write-, or update-statement: if atomic clause is... capture or read capture-statement: v = x capture or write write-statement : x = expr capture or update or is not present update-statement: x = x operator expr x = expr operator x x = intrinsic_procedure_name ( x, expr_list) x = intrinsic_procedure_name ( expr_list, x) intrinsic_procedure_name: MAX, MIN, IAND, IOR, IEOR operator is one of +, *, -, /, .AND., .OR., .EQV., .NEQV. flush [2.17.8] [2.13.7] Makes a thread’s temporary view of memory consistent with memory, and enforces an order on the memory operations of the variables. C/C++ #pragma omp flush [memory-order-clause] [(list)] For !$omp flush [memory-order-clause] [(list)] memory-order-clause: acq_rel, release, or acquire ordered [2.17.9] [2.13.8] Specifies a structured block that is to be executed in loop iteration order in a parallelized loop, or it specifies cross iteration dependences in a doacross loop nest. C/C++ #pragma omp ordered [clause[[, ] clause] ] structured-block - or - #pragma omp ordered clause[[[, ] clause]...] For !$omp ordered [clause[[, ] clause]] structured-block !$omp end ordered - or - !$omp ordered clause[[[, ]clause] ...] clause (for the first form): threads or simd clause (for the second form): depend (source) or depend (sink : vec) Continued4 Continued4
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有