Skip to content

Commit 7eade98

Browse files
committed
Update on "[ET-VK] Enable dynamic operator registration"
This change follows 1. in the footsteps of #2222 for static initialization and 2. the popular `TorchLibraryImpl` for wrapping with macros. https://www.internalfb.com/code/fbsource/[b6860acf0fd7a95224f2ed3f6fe48f699a9a45c0]/fbcode/caffe2/torch/library.h?lines=1004%2C1012-1026 Contributors can now write their operator and register them within the same file using `REGISTER_OPERATORS` + `VK_REGISTER_OP()`, as shown in `Arithmetic.h/cpp`. Typically in Linux/Android C++ environments, the symbols corresponding to `OperatorRegisterInit` static instances are discarded since they aren't used for anything other than static initialization. Hence, we need to `link_whole = True` for the `vulkan_graph_runtime` library. We update our Compute API tests to verify we can go through `OperatorRegistry` with proper static initialization. Differential Revision: [D54641117](https://our.internmc.facebook.com/intern/diff/D54641117/) [ghstack-poisoned]
1 parent ab8e250 commit 7eade98

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

backends/vulkan/test/vulkan_compute_api_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <ATen/native/vulkan/api/api.h>
1212

1313
#include <ATen/native/vulkan/impl/Arithmetic.h>
14-
#include <ATen/native/vulkan/impl/Common.h>
1514
#include <ATen/native/vulkan/impl/Packing.h>
1615

1716
#include <executorch/backends/vulkan/runtime/graph/ops/OperatorRegistry.h>

0 commit comments

Comments
 (0)