- 
                Notifications
    You must be signed in to change notification settings 
- Fork 706
[3/N] Add get_option/set_option function in backend interface #11391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
c4a952a
              f2249b3
              ea2d27b
              efa67f3
              a7cc325
              5d11e43
              f22aa3f
              1ce04a3
              9b2f120
              99bef8c
              071633b
              645217a
              0ff8ff3
              d2877cd
              627c655
              7c065a9
              e58aa46
              4bb3c08
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -12,6 +12,8 @@ | |
|  | ||
| #include <executorch/runtime/backend/backend_execution_context.h> | ||
| #include <executorch/runtime/backend/backend_init_context.h> | ||
| #include <executorch/runtime/backend/backend_update_context.h> | ||
| #include <executorch/runtime/backend/backend_options.h> | ||
| #include <executorch/runtime/core/array_ref.h> | ||
| #include <executorch/runtime/core/error.h> | ||
| #include <executorch/runtime/core/evalue.h> | ||
|  | @@ -99,6 +101,20 @@ class BackendInterface { | |
| DelegateHandle* handle, | ||
| EValue** args) const = 0; | ||
|  | ||
| /** | ||
| * Responsible update the backend status, if any. The backend options are passed in | ||
| * by users, and the backend can update its internal status based on the options. | ||
| * | ||
| * @param[in] context Runtime context if any. Currently it's not used. | ||
| * @param[in] args A list of BackendOptions passed in by users. | ||
| * @retval Error::Ok if successful. | ||
| */ | ||
| ET_NODISCARD virtual Error update( | ||
| BackendUpdateContext& context, | ||
|          | ||
| const executorch::runtime::ArrayRef<BackendOption>& backend_options) const { | ||
| return Error::Ok; | ||
| }; | ||
|          | ||
|  | ||
| /** | ||
| * Responsible for destroying a handle, if it's required for some backend. | ||
| * It may be needed for some backends. For example, resources associated with | ||
|  | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would jsut call it set_backend_options which seems more appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of like this API name more, but we can discuss about it.