@@ -22,7 +22,7 @@ using executorch::runtime::ArrayRef;
2222using executorch::runtime::Error;
2323using executorch::runtime::BackendExecutionContext;
2424using executorch::runtime::EValue;
25- using executorch::runtime::BackendUpdateContext ;
25+ using executorch::runtime::BackendOptionContext ;
2626using executorch::runtime::BackendOption;
2727using executorch::runtime::BackendOptions;
2828using executorch::runtime::Backend;
@@ -55,7 +55,7 @@ class MockBackend : public BackendInterface {
5555 }
5656
5757 Error set_option (
58- BackendUpdateContext & context,
58+ BackendOptionContext & context,
5959 const executorch::runtime::Span<BackendOption>& backend_options) override {
6060 set_option_count++;
6161 int sucess_update = 0 ;
@@ -111,7 +111,7 @@ class MockBackend : public BackendInterface {
111111};
112112
113113TEST_F (BackendInterfaceUpdateTest, HandlesInvalidOption) {
114- BackendUpdateContext context;
114+ BackendOptionContext context;
115115
116116 // Test invalid key case
117117 BackendOption invalid_option{
@@ -126,7 +126,7 @@ TEST_F(BackendInterfaceUpdateTest, HandlesInvalidOption) {
126126}
127127
128128 TEST_F (BackendInterfaceUpdateTest, HandlesStringOption) {
129- BackendUpdateContext context;
129+ BackendOptionContext context;
130130 options.set_option (StrKey (" Backend" ), " GPU" );
131131 // // Create a backend option to pass to update
132132
@@ -143,7 +143,7 @@ TEST_F(BackendInterfaceUpdateTest, HandlesIntOption) {
143143 // Check the default num_threads value is 0
144144 EXPECT_EQ (mock_backend->debug , false );
145145 // Create a mock context (needs to be defined or mocked)
146- BackendUpdateContext context;
146+ BackendOptionContext context;
147147
148148 int expected_num_threads = 4 ;
149149
@@ -160,7 +160,7 @@ TEST_F(BackendInterfaceUpdateTest, HandlesBoolOption) {
160160 // Check the default num_threads value is 0
161161 EXPECT_EQ (mock_backend->debug , false );
162162 // Create a mock context (needs to be defined or mocked)
163- BackendUpdateContext context;
163+ BackendOptionContext context;
164164
165165 options.set_option (BoolKey (" Debug" ), true );
166166
@@ -175,7 +175,7 @@ TEST_F(BackendInterfaceUpdateTest, HandlesMultipleOptions) {
175175 // Check the default num_threads value is 0
176176 EXPECT_EQ (mock_backend->debug , false );
177177 // Create a mock context (needs to be defined or mocked)
178- BackendUpdateContext context;
178+ BackendOptionContext context;
179179
180180 options.set_option (BoolKey (" Debug" ), true );
181181 options.set_option (IntKey (" NumberOfThreads" ), 4 );
@@ -191,7 +191,7 @@ TEST_F(BackendInterfaceUpdateTest, HandlesMultipleOptions) {
191191}
192192
193193TEST_F (BackendInterfaceUpdateTest, UpdateBeforeInit) {
194- BackendUpdateContext update_context ;
194+ BackendOptionContext option_context ;
195195 MemoryAllocator memory_allocator{MemoryAllocator (0 , nullptr )};
196196
197197 BackendInitContext init_context (&memory_allocator);
@@ -200,7 +200,7 @@ TEST_F(BackendInterfaceUpdateTest, UpdateBeforeInit) {
200200 options.set_option (StrKey (" Backend" ), " GPU" );
201201
202202 // Update before init
203- Error err = mock_backend->set_option (update_context , options.view ());
203+ Error err = mock_backend->set_option (option_context , options.view ());
204204 EXPECT_EQ (err, Error::Ok);
205205
206206 // Now call init
@@ -218,7 +218,7 @@ TEST_F(BackendInterfaceUpdateTest, UpdateBeforeInit) {
218218}
219219
220220TEST_F (BackendInterfaceUpdateTest, UpdateAfterInitBeforeExecute) {
221- BackendUpdateContext update_context ;
221+ BackendOptionContext option_context ;
222222 MemoryAllocator init_memory_allocator{MemoryAllocator (0 , nullptr )};
223223 BackendInitContext init_context (&init_memory_allocator);
224224 BackendExecutionContext execute_context;
@@ -235,7 +235,7 @@ TEST_F(BackendInterfaceUpdateTest, UpdateAfterInitBeforeExecute) {
235235
236236 // Now update
237237 options.set_option (StrKey (" Backend" ), " CPU" );
238- Error err = mock_backend->set_option (update_context , options.view ());
238+ Error err = mock_backend->set_option (option_context , options.view ());
239239 EXPECT_EQ (err, Error::Ok);
240240
241241 // Now execute
@@ -252,7 +252,7 @@ TEST_F(BackendInterfaceUpdateTest, UpdateAfterInitBeforeExecute) {
252252}
253253
254254TEST_F (BackendInterfaceUpdateTest, UpdateBetweenExecutes) {
255- BackendUpdateContext update_context ;
255+ BackendOptionContext option_context ;
256256 MemoryAllocator init_memory_allocator{MemoryAllocator (0 , nullptr )};
257257 BackendInitContext init_context (&init_memory_allocator);
258258 BackendExecutionContext execute_context;
@@ -271,7 +271,7 @@ TEST_F(BackendInterfaceUpdateTest, UpdateBetweenExecutes) {
271271
272272 // Update between executes
273273 options.set_option (StrKey (" Backend" ), " NPU" );
274- err = mock_backend->set_option (update_context , options.view ());
274+ err = mock_backend->set_option (option_context , options.view ());
275275 EXPECT_EQ (err, Error::Ok);
276276
277277 // Second execute
0 commit comments