-
Notifications
You must be signed in to change notification settings - Fork 593
[3/N] Add update 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
base: gh/cccclai/23/base
Are you sure you want to change the base?
Changes from all commits
c4a952a
f2249b3
ea2d27b
efa67f3
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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is supposed to be the role of BackendUpdateContext? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a place holder for future API changes. Currently have the context for init and execute |
||
const executorch::runtime::ArrayRef<BackendOption>& backend_options) const { | ||
return Error::Ok; | ||
}; | ||
Comment on lines
+113
to
+116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is the implementation of this? If it is in the next diff, can you pull it here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the base function. If backends didn't implement this function, this function will be called. If we set it to virtual, then we need all backends to implement this fucntion. |
||
|
||
/** | ||
* 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