Skip to content

libomptarget

Ye Luo edited this page Aug 6, 2020 · 18 revisions

micro steps in omptarget.

  1. Resolve dependency in. wait for events
  2. Enter data region. map handling, allocate memory and increase reference counting. Generate H2D and D2H pair lists (for 'always' modifier), first-private array list.
  3. Transfer H2D
  4. Launch kernel
  5. Transfer D2H
  6. Exit data region. map handling, decrease reference counting, delete first-private array items.
  7. Create dependency out. record events. Rules:
  • q_start must be before 1. because some dependency may be enqueued.
  • q_stop must be before 6. it also includes a sync. transfers triggered by refcount 1->0 can just call the blocking memcopy.

Decompose target constructs:

In nowait case,

  • target: q_start, 1-5, q_stop, 6-7
  • target data:. q_start 1-3, q_stop, host region, q_start, 5, q_stop, 6-7
  • target enter data: q_start, 1-3, q_stop, 7
  • target exit data: q_start, 1, 5, q_stop, 6-7
  • target update q_start, 1-3, 5, q_stop, 6-7

Without nowait clause and depdency, remove step 1 and 7.

Clone this wiki locally