You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce ParamsBindList to prevent needing to pass shared_ptr to bind parameter UBOs (#3150)
Summary:
Pull Request resolved: #3150
## Context
In keeping with the below changeset in this stack, this diff introduces the `ParamsBindList` structure to avoid storing shared pointers to `api::UniformParamsBuffer` objects in `ExecuteNode` and `PrepackNode`.
The idea is to store the binding information of each UPB instead of taking ownership of the UPB itself. There isn't really a need for `ExecuteNode` and `PrepackNode` to take ownership since `ComputeGraph` provides a guarantee that the UPBs will be in scope at the time of binding.
With this change, all `shared_ptr` members can be eliminated from `vTensor`, further reducing heap allocations and pointer chasing.
In the future I will change `prepack_nodes_` and `execute_nodes_` to store `PrepackNode` and `ExecuteNode` instances directly instead of storing unique pointers to them.
ghstack-source-id: 223225899
exported-using-ghexport
Reviewed By: jorgep31415
Differential Revision: D56357188
fbshipit-source-id: 5f4d1be900711753aa2cc035c044fe71f93d555b
0 commit comments