Skip to content

Commit 9348fcc

Browse files
committed
Update on "[2/N] Add update context"
For future needs without breacking API BC, in case we need to pass more information to the update API Differential Revision: [D75919212](https://our.internmc.facebook.com/intern/diff/D75919212/) Differential Revision: [D75919212](https://our.internmc.facebook.com/intern/diff/D75919212) [ghstack-poisoned]
2 parents 1884acf + dad370d commit 9348fcc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

runtime/backend/backend_options.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#pragma once
1010
#include <executorch/runtime/core/error.h>
11+
#include <executorch/runtime/core/span.h>
1112
#include <cstddef>
1213
#include <cstring>
1314
#include <variant>
@@ -71,6 +72,15 @@ class BackendOptions {
7172
return Error::NotFound;
7273
}
7374

75+
executorch::runtime::Span<BackendOption> view() const {
76+
return executorch::runtime::Span<BackendOption>(options_, size_);
77+
}
78+
79+
// Non-const version that allows modification of the underlying data
80+
executorch::runtime::Span<BackendOption> view() {
81+
return executorch::runtime::Span<BackendOption>(options_, size_);
82+
}
83+
7484
private:
7585
BackendOption options_[MaxCapacity]{}; // Storage for backend options
7686
size_t size_; // Current number of options

0 commit comments

Comments
 (0)