Defined in File cg.h
allocation strategy for device storage in computing graphs
Note: all the graph params would be NULL for requests originating from ComputingGraph::prealloc_static_storage. Otherwise they are not NULL.
This base class already provides an implementation using memory management on the comp node. Sub-classes can override only the methods of interest.
implement the allocation strategy for static graph-wise storage
[in] graph: the computing graph that requests the memory
[out] dest: output tensor storage; its comp node has been initialized to target comp node
implement the allocation strategy for dynamic storage of a variable
Note: if allocation fails,
[in] var: the variable that needs memory
Ensure a contiguous storage for memory defragmenter.
When doing memory-defragmentation, it is useful to ensure that following allocation requests can be placed in a contiguous storage. This function would be called before calling alloc_dynamic() on the individual vars.
version of static allocation strategy
If version changes before graph exec, static memory would be reallocated. This function would be only called once in each graph execution.
Public Static Attributes
a version sentinel value that should never be returned by static_alloc_version()