Organize utils (#2323)
Summary:
bypass-github-export-checks
Pull Request resolved: https://github.com/pytorch/executorch/pull/2323
Refactor our `OpUtils.*`, `StagingUtils.*`, and `Utils.*` which have accumulated helper functions during the redesign.
We split them and move them into two new folders:
1. `ops/utils`: Used by files in `ops/` and `ops/impl/`.
2. `ops/impl/utils`: Used only by files in `ops/impl/`.
In general, this helps to unflatten the `ops/` directory:
```
[jorgep31415@devvm15882.vll0 /data/users/jorgep31415/fbsource/xplat/executorch/backends/vulkan/runtime/graph/ops (98b0e789c)]$ tree
.
├── ExecuteNode.cpp
├── ExecuteNode.h
├── impl
│ ├── Arithmetic.cpp
│ ├── Arithmetic.h
│ ├── Staging.cpp
│ ├── Staging.h
│ └── utils
│ ├── DimUtils.h
│ ├── ScalarUtils.h
│ ├── TensorUtils.cpp
│ └── TensorUtils.h
├── OperatorRegistry.cpp
├── OperatorRegistry.h
├── PrepackNode.cpp
├── PrepackNode.h
└── utils
├── BindingUtils.cpp
├── BindingUtils.h
├── StagingUtils.cpp
└── StagingUtils.h
3 directories, 18 files
```
Since we're heavily updating include declarations, we also introduce the convention to only include the VK-API via
```
#include <ATen/native/vulkan/api/api.h>
```
instead of including more specific files, e.g.,
```
#include <ATen/native/vulkan/api/Tensor.h>
```
ghstack-source-id: 217990425
exported-using-ghexport
Reviewed By: SS-JIA
Differential Revision: D54690346
fbshipit-source-id: ac5c0713fa73ab51ef6fbfc40e48198ab3fe627c J
Jorge Pineda committed
ac8267b03e806322363fa75859f1d28a0109a66b
Parent: e5c2853
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 3/8/2024, 11:02:22 PM