Skip to content

Better define graph memory allocation semantics #39

@EwanC

Description

@EwanC

Based on feedback we should better define how memory allocation/free nodes behave in a graph. There are several aspects to this:

  1. What is the lifetime of the memory? My understanding is that if a memory is both allocated and freed by a graph then it is owned by the graph. However, memory may only be allocated by the graph without an associated free node in which case the memory can be used outside the graph and must be freed by the user with sycl::free(). We should explicitly say this.

  2. Relationship between memory allocations in an executable graph v a modifiable graph. That is, if the same modifiable graph is finalized to two executable graph objects, do they point to the same memory. My understanding is that they do not, but we should say this explicitly in the spec.

  3. Relationship with USM. If we expect the usage of the usage of the pointers returned to be the same as device USM, then we should say that explicitly in the spec.

  4. Invalid usage of free - We should specify that it is undefined behaviour if the pointer passed to add_free is already freed or not valid address

Metadata

Metadata

Assignees

Labels

Graph SpecificationExtension Specification relatedSpec Revision 2Targetting the second revision of the specificationUSM

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions