-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebNN: Refactor GraphBuilder of DirectML backend
The Refactoring includes: - Introduce decoupled `InputNode` and `OperatorNode` that inherits `Node`. `InputNode` encapsulates graph input index while `OperatorNode` encapsulates operator node index and DirectML operator respectively. `NodeOutput` can be created for both types of node and connected to another `OperatorNode` - GraphBuilder creates and maintains the `InputNode`s, `OperatorNode`s and `NodeOutput`s in `std::list`s. Users reference them by pointers. It’s users’ responsibility to ensure these pointers do not outlive the GraphBuilder. - Remove `NodeOutputInfo` and `GraphBuilder::GetNodeOutput` that reduces one indirection for the user code. - `GraphBuilder::CreateOperatorNode()` returns a `nullptr` when `IDMLDevice::CreateOperator()` fails. - Use `base::span` to pass the `const NodeOutput*` array that avoids unnecessary heap allocation. Bug: 1273291 Change-Id: I82c801c437cf3fcd44568c947d318201bedb624a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4871184 Commit-Queue: ningxin hu <ningxin.hu@intel.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1209173}
- Loading branch information
Showing
4 changed files
with
487 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.