Skip to content

Commit

Permalink
Add note advising caution when using host task that captures by refer…
Browse files Browse the repository at this point in the history
…ence
  • Loading branch information
hdelan committed Dec 7, 2023
1 parent 64950fb commit fd67962
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14622,6 +14622,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 fd67962

Please sign in to comment.