Skip to content

Commit 312cb7a

Browse files
GregoryComerfacebook-github-bot
authored andcommitted
Add backend option setter to the dynamic shim (#13891)
Summary: Pull Request resolved: #13891 Add a new function to the dynamic shim interface to set runtime backend options with integer values. I've added this as a top-level function, intended to be loaded with dlsym, as opposed to on the DynamicShim class, as it needs to be set pre-model load. Long-term, the whole shim interface needs to be refactored and we should likely have some sort of runtime abstraction to include this. As such, I'm not worrying about providing a full set of methods to get/set all option types. I've also exposed XNNPACKBackend.h through a new buck target - xnnpack_interface. This is so that users don't have to hard-code keys. I might refactor this in the future, as it would be nice to have it be clearer what this header/target is intended for. Differential Revision: D79314050
1 parent 0b0e2dc commit 312cb7a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

backends/xnnpack/runtime/XNNPACKBackend.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma once
22

3-
#include <executorch/runtime/platform/compiler.h>
4-
53
namespace executorch::backends::xnnpack {
64
/// The key for the backend. This is used to register the backend, check
75
/// availability, and get/set options.

backends/xnnpack/targets.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,13 @@ def define_common_targets():
7373
# @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole)
7474
link_whole = True,
7575
)
76+
77+
runtime.cxx_library(
78+
name = "xnnpack_interface",
79+
visibility = [
80+
"@EXECUTORCH_CLIENTS",
81+
],
82+
exported_headers = [
83+
"runtime/XNNPACKBackend.h",
84+
],
85+
)

0 commit comments

Comments
 (0)