@@ -315,6 +315,16 @@ class no_cycle_check {
315315 no_cycle_check() = default;
316316};
317317
318+ class assume_buffer_outlives_graph {
319+ public:
320+ assume_buffer_outlives_graph() = default;
321+ };
322+
323+ class assume_data_outlives_buffer {
324+ public:
325+ assume_data_outlives_buffer() = default;
326+ };
327+
318328} // namespace graph
319329
320330namespace node {
@@ -542,12 +552,12 @@ property results in undefined behaviour.
542552===== Assume-Data-Outlives-Buffer Property [[assume-data-outlives-buffer-property]]
543553The `property::graph::assume_data_outlives_buffer` property disables
544554restrictions on using buffers which have been created with a host pointer
545- in a `command_graph` and can be passed to a `command_graph` on construction
555+ in a `command_graph`, and can be passed to a `command_graph` on construction
546556via the property list parameter. This property represents a promise from the
547557user that any host data passed to a buffer's constructor will outlive the
548558buffer itself, and by extension any graph in which that buffer is used.
549- Deleting or otherwise modifying this data during the lifetime of the buffer
550- or graph results in undefined behaviour when using this property.
559+ Deleting or otherwise modifying this host data during the lifetime of the
560+ buffer or graph results in undefined behaviour when using this property.
551561
552562==== Graph Member Functions
553563
@@ -1089,7 +1099,7 @@ synchronously with error code `invalid`.
10891099==== Buffer Limitations
10901100
10911101The use of buffers inside a `command_graph` is restricted unless the user
1092- creates the graph with the <<assume-buffer-outlives-graph, Assume-Buffer-Outlives-Graph>>
1102+ creates the graph with the <<assume-buffer-outlives-graph-property , Assume-Buffer-Outlives-Graph>>
10931103property. Buffer lifetimes are not extended by a `command_graph` in which they
10941104are used and so the user must ensure that their lifetimes exceed that of the
10951105`command_graph`. Attempting to use a buffer in a `command_graph` without this
@@ -1101,7 +1111,7 @@ host data pointer in commands recorded to a `command_graph`. Because of the
11011111delayed execution of a `command_graph`, data may not be copied to the device
11021112immediately when commands using these buffers are submitted to the graph,
11031113therefore the host data must also outlive the graph to ensure correct behaviour.
1104- Users can pass the <<assume-data-outlives-buffer, Assume-Data-Outlives-Buffer>>
1114+ Users can pass the <<assume-data-outlives-buffer-property , Assume-Data-Outlives-Buffer>>
11051115property to the graph constructor to provide a promise that this will not occur
11061116and that it is safe to use this buffer in the graph.
11071117
0 commit comments