Skip to content

Commit

Permalink
Merge pull request #515 from hdelan/clarify-host-task-ref-val-capture
Browse files Browse the repository at this point in the history
Clarify that capture by ref host_task requires caution
  • Loading branch information
gmlueck authored Dec 14, 2023
2 parents cd5768d + 4e2439c commit bfe3330
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions adoc/chapters/acknowledgements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Verena Beckham, Codeplay
* Aidan Belton, Codeplay
* Gordon Brown, Codeplay
* Hugh Delaney, Codeplay
* Morris Hafner, Codeplay
* Alexander Johnston, Codeplay
* Marios Katsigiannis, Codeplay
Expand Down
9 changes: 9 additions & 0 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14625,6 +14625,15 @@ interoperability member functions provided by the [code]#interop_handle# class.

Local <<accessor,accessors>> cannot be used within a <<host-task>>.

[NOTE]
====
If a C++ lambda is passed to a <<host-task>>, the lambda may capture by
reference or by value.
Since the <<host-task>> callable executes asynchronously, care must be taken to
ensure that lifetimes of objects captured by reference by a <<host-task>> lambda
last at least until the <<host-task>> completes.
====

// TODO: access mode/target resolution rules

[source,,linenums]
Expand Down

0 comments on commit bfe3330

Please sign in to comment.