Skip to content

Commit 8aca441

Browse files
jorgep31415facebook-github-bot
authored andcommitted
Refactor graph directory structure (#2151)
Summary: Pull Request resolved: #2151 I always get lost in the current structure, so we 1. introduce `containers/`, `ops/`, and `ops/impl/` to flatten the directory, and 2. fix some include header ordering. ``` [[email protected] /data/users/jorgep31415/fbsource/fbcode/executorch/backends/vulkan/runtime/graph (4f468a807)]$ tree . ├── ComputeGraph.cpp ├── ComputeGraph.h ├── containers │ ├── Constant.cpp │ ├── Constant.h │ ├── SharedObject.cpp │ ├── SharedObject.h │ ├── Types.cpp │ ├── Types.h │ └── Value.h ├── GraphConfig.h └── ops ├── ExecuteNode.h ├── Functions.cpp ├── Functions.h ├── impl │ ├── Arithmetic.cpp │ ├── Arithmetic.h │ ├── Copy.cpp │ ├── Copy.h │ ├── Staging.cpp │ └── Staging.h ├── OperatorRegistry.cpp ├── OperatorRegistry.h └── PrepackNode.h 3 directories, 22 files ``` ghstack-source-id: 216697508 exported-using-ghexport Reviewed By: SS-JIA Differential Revision: D54272391 fbshipit-source-id: 204279e72d228685bb18fe5eebf0115a68e87d55
1 parent 3ed5144 commit 8aca441

24 files changed

+38
-32
lines changed

backends/vulkan/runtime/VulkanBackend.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/backends/vulkan/runtime/graph/ComputeGraph.h>
10-
#include <executorch/backends/vulkan/runtime/graph/OperatorRegistry.h>
11-
129
#include <executorch/backends/vulkan/runtime/VulkanDelegateHeader.h>
1310
#include <executorch/backends/vulkan/schema_generated.h>
1411

12+
#include <executorch/backends/vulkan/runtime/graph/ComputeGraph.h>
13+
14+
#include <executorch/backends/vulkan/runtime/graph/ops/OperatorRegistry.h>
15+
1516
#include <executorch/runtime/backend/interface.h>
1617
#include <executorch/runtime/core/error.h>
1718
#include <executorch/runtime/core/evalue.h>

backends/vulkan/runtime/graph/ComputeGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include <executorch/backends/vulkan/runtime/graph/ComputeGraph.h>
1010

11-
#include <executorch/backends/vulkan/runtime/graph/ops/Staging.h>
11+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Staging.h>
1212

1313
namespace at {
1414
namespace native {

backends/vulkan/runtime/graph/ComputeGraph.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
#include <ATen/native/vulkan/api/Tensor.h>
1717
#include <ATen/native/vulkan/api/Types.h>
1818

19-
#include <executorch/backends/vulkan/runtime/graph/Config.h>
20-
#include <executorch/backends/vulkan/runtime/graph/ExecuteNode.h>
21-
#include <executorch/backends/vulkan/runtime/graph/PrepackNode.h>
22-
#include <executorch/backends/vulkan/runtime/graph/SharedObject.h>
23-
#include <executorch/backends/vulkan/runtime/graph/Value.h>
19+
#include <executorch/backends/vulkan/runtime/graph/GraphConfig.h>
20+
21+
#include <executorch/backends/vulkan/runtime/graph/containers/SharedObject.h>
22+
#include <executorch/backends/vulkan/runtime/graph/containers/Value.h>
23+
24+
#include <executorch/backends/vulkan/runtime/graph/ops/ExecuteNode.h>
25+
#include <executorch/backends/vulkan/runtime/graph/ops/PrepackNode.h>
2426

2527
namespace at {
2628
namespace native {

backends/vulkan/runtime/graph/Constant.cpp renamed to backends/vulkan/runtime/graph/containers/Constant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/backends/vulkan/runtime/graph/Constant.h>
9+
#include <executorch/backends/vulkan/runtime/graph/containers/Constant.h>
1010

1111
namespace at {
1212
namespace native {

backends/vulkan/runtime/graph/SharedObject.cpp renamed to backends/vulkan/runtime/graph/containers/SharedObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/backends/vulkan/runtime/graph/SharedObject.h>
9+
#include <executorch/backends/vulkan/runtime/graph/containers/SharedObject.h>
1010

1111
#include <executorch/backends/vulkan/runtime/graph/ComputeGraph.h>
1212

backends/vulkan/runtime/graph/SharedObject.h renamed to backends/vulkan/runtime/graph/containers/SharedObject.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
#include <ATen/native/vulkan/api/Tensor.h>
1717
#include <ATen/native/vulkan/api/Types.h>
1818

19-
#include <executorch/backends/vulkan/runtime/graph/Config.h>
20-
#include <executorch/backends/vulkan/runtime/graph/Value.h>
19+
#include <executorch/backends/vulkan/runtime/graph/GraphConfig.h>
20+
21+
#include <executorch/backends/vulkan/runtime/graph/containers/Value.h>
2122

2223
namespace at {
2324
namespace native {

backends/vulkan/runtime/graph/Types.cpp renamed to backends/vulkan/runtime/graph/containers/Types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/backends/vulkan/runtime/graph/Types.h>
9+
#include <executorch/backends/vulkan/runtime/graph/containers/Types.h>
1010

1111
namespace at {
1212
namespace native {

backends/vulkan/runtime/graph/Value.h renamed to backends/vulkan/runtime/graph/containers/Value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#include <ATen/native/vulkan/api/Context.h>
1616
#include <ATen/native/vulkan/api/Tensor.h>
1717

18-
#include <executorch/backends/vulkan/runtime/graph/Constant.h>
19-
#include <executorch/backends/vulkan/runtime/graph/Types.h>
18+
#include <executorch/backends/vulkan/runtime/graph/containers/Constant.h>
19+
#include <executorch/backends/vulkan/runtime/graph/containers/Types.h>
2020

2121
namespace at {
2222
namespace native {

backends/vulkan/runtime/graph/ExecuteNode.h renamed to backends/vulkan/runtime/graph/ops/ExecuteNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <ATen/native/vulkan/api/Tensor.h>
1515
#include <ATen/native/vulkan/api/Types.h>
1616

17-
#include <executorch/backends/vulkan/runtime/graph/Value.h>
17+
#include <executorch/backends/vulkan/runtime/graph/containers/Value.h>
1818

1919
namespace at {
2020
namespace native {

backends/vulkan/runtime/graph/Functions.cpp renamed to backends/vulkan/runtime/graph/ops/Functions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
#include <executorch/backends/vulkan/runtime/graph/ops/Functions.h>
10+
911
#include <ATen/native/vulkan/impl/Arithmetic.h>
1012
#include <ATen/native/vulkan/impl/Common.h>
1113

12-
#include <executorch/backends/vulkan/runtime/graph/Functions.h>
13-
14-
#include <executorch/backends/vulkan/runtime/graph/ops/Arithmetic.h>
14+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Arithmetic.h>
1515

1616
namespace at {
1717
namespace native {

backends/vulkan/runtime/graph/OperatorRegistry.cpp renamed to backends/vulkan/runtime/graph/ops/OperatorRegistry.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/backends/vulkan/runtime/graph/Functions.h>
10-
#include <executorch/backends/vulkan/runtime/graph/OperatorRegistry.h>
9+
#include <executorch/backends/vulkan/runtime/graph/ops/OperatorRegistry.h>
10+
11+
#include <executorch/backends/vulkan/runtime/graph/ops/Functions.h>
1112

1213
namespace at {
1314
namespace native {

backends/vulkan/runtime/graph/PrepackNode.h renamed to backends/vulkan/runtime/graph/ops/PrepackNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <ATen/native/vulkan/api/Tensor.h>
1515
#include <ATen/native/vulkan/api/Types.h>
1616

17-
#include <executorch/backends/vulkan/runtime/graph/Value.h>
17+
#include <executorch/backends/vulkan/runtime/graph/containers/Value.h>
1818

1919
namespace at {
2020
namespace native {

backends/vulkan/runtime/graph/ops/Arithmetic.cpp renamed to backends/vulkan/runtime/graph/ops/impl/Arithmetic.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Arithmetic.h>
10+
911
#include <ATen/native/vulkan/impl/Common.h>
1012

11-
#include <executorch/backends/vulkan/runtime/graph/ops/Arithmetic.h>
12-
#include <executorch/backends/vulkan/runtime/graph/ops/Staging.h>
13+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Staging.h>
1314

1415
namespace at {
1516
namespace native {

backends/vulkan/runtime/graph/ops/Copy.cpp renamed to backends/vulkan/runtime/graph/ops/impl/Copy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <executorch/backends/vulkan/runtime/graph/ops/Copy.h>
9+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Copy.h>
1010

1111
namespace at {
1212
namespace native {

backends/vulkan/runtime/graph/ops/Staging.cpp renamed to backends/vulkan/runtime/graph/ops/impl/Staging.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
#include <ATen/native/vulkan/impl/Packing.h>
9+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Staging.h>
1010

11-
#include <executorch/backends/vulkan/runtime/graph/ops/Staging.h>
11+
#include <ATen/native/vulkan/impl/Packing.h>
1212

1313
namespace at {
1414
namespace native {

backends/vulkan/runtime/graph/ops/Staging.h renamed to backends/vulkan/runtime/graph/ops/impl/Staging.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
#ifdef USE_VULKAN_API
1212

13-
#include <string.h>
14-
1513
#include <executorch/backends/vulkan/runtime/graph/ComputeGraph.h>
1614

15+
#include <string.h>
16+
1717
namespace at {
1818
namespace native {
1919
namespace vulkan {

backends/vulkan/test/vulkan_compute_api_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include <ATen/native/vulkan/impl/Arithmetic.h>
1414
#include <ATen/native/vulkan/impl/Packing.h>
1515

16-
#include <executorch/backends/vulkan/runtime/graph/ops/Arithmetic.h>
17-
#include <executorch/backends/vulkan/runtime/graph/ops/Staging.h>
16+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Arithmetic.h>
17+
#include <executorch/backends/vulkan/runtime/graph/ops/impl/Staging.h>
1818

1919
using namespace at::native::vulkan;
2020

0 commit comments

Comments
 (0)