Skip to content

Commit cfcf13b

Browse files
cccclaifacebook-github-bot
authored andcommitted
Update backend execute args in test (#6708)
Summary: Similar to #6673, we update the execute args the same as the actual interface https://github.com/pytorch/executorch/blob/836d5561a61877507b6d5891485725996bb6b32c/runtime/backend/interface.h?fbclid=IwZXh0bgNhZW0CMTEAAR37pGH_HbSLZTCatfjnXGr_CLc8Th-SpoS4CeKb00z1ngNBJd6OdniK19Q_aem_xk7M6diLe_FAsplz8BZRQg#L96-L99 Reviewed By: kirklandsign Differential Revision: D65585157
1 parent dc41596 commit cfcf13b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

runtime/executor/test/backend_integration_test.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class StubBackend final : public BackendInterface {
5656
FreeableBuffer*,
5757
ArrayRef<CompileSpec>,
5858
BackendInitContext&)>;
59-
using ExecuteFn = std::function<Error(DelegateHandle*, EValue**)>;
59+
using ExecuteFn =
60+
std::function<Error(BackendExecutionContext&, DelegateHandle*, EValue**)>;
6061
using DestroyFn = std::function<void(DelegateHandle*)>;
6162

6263
// Default name that this backend is registered as.
@@ -98,7 +99,7 @@ class StubBackend final : public BackendInterface {
9899
DelegateHandle* handle,
99100
EValue** args) const override {
100101
if (execute_fn_) {
101-
return execute_fn_.value()(handle, args);
102+
return execute_fn_.value()(context, handle, args);
102103
}
103104
// Return a benign value otherwise.
104105
return Error::Ok;
@@ -404,7 +405,9 @@ TEST_P(BackendIntegrationTest, EndToEndTestWithProcessedAsHandle) {
404405
// FreeableBuffer.
405406
DelegateHandle* execute_handle = nullptr;
406407
StubBackend::singleton().install_execute(
407-
[&](DelegateHandle* handle, ET_UNUSED EValue** args) -> Error {
408+
[&](ET_UNUSED BackendExecutionContext& backend_execution_context,
409+
DelegateHandle* handle,
410+
ET_UNUSED EValue** args) -> Error {
408411
execute_handle = handle;
409412
auto* processed = reinterpret_cast<FreeableBuffer*>(handle);
410413

0 commit comments

Comments
 (0)