@@ -113,7 +113,7 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
113
113
BackendInitContext& context,
114
114
FreeableBuffer* processed,
115
115
ArrayRef<CompileSpec> compile_specs) const override {
116
- ET_LOG (Info, " EthosUBackend::init %p" , processed->data ());
116
+ ET_LOG (Info, " data: %p" , processed->data ());
117
117
118
118
const char * data = static_cast <const char *>(processed->data ());
119
119
size_t size = processed->size ();
@@ -173,7 +173,7 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
173
173
static_cast <const char *>(execution_handle->processed ->data ());
174
174
EXECUTORCH_PROF_END (event_tracer, event_tracer_local_scope);
175
175
176
- ET_LOG (Debug, " EthosUBackend::execute %p" , data);
176
+ ET_LOG (Debug, " data: %p" , data);
177
177
178
178
EXECUTORCH_PROF_START (
179
179
event_tracer,
@@ -182,7 +182,7 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
182
182
// Read key sections from the vela_bin_stream
183
183
if (vela_bin_read (data, &handles, execution_handle->processed ->size ()) ==
184
184
false ) {
185
- ET_LOG (Error, " EthosUBackend:: vela_read: error, invalid binary layout" );
185
+ ET_LOG (Error, " vela_read: error, invalid binary layout" );
186
186
return Error::InvalidProgram;
187
187
}
188
188
EXECUTORCH_PROF_END (event_tracer, event_tracer_local_scope);
@@ -193,9 +193,16 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
193
193
// the end of the execution of the Ethos-U custom delegate
194
194
char * ethosu_scratch =
195
195
static_cast <char *>(temp_allocator->allocate (handles.scratch_data_size ));
196
+ if (ethosu_scratch == nullptr ) {
197
+ ET_LOG (
198
+ Error,
199
+ " Failed to allocate scratch buffer of %zu bytes from temp_allocator" ,
200
+ handles.scratch_data_size );
201
+ return Error::MemoryAllocationFailed;
202
+ }
196
203
ET_LOG (
197
204
Debug,
198
- " EthosUBackend::execute: Running program data:\n cmd %p %zu\n weight %p %zu\n scratch %p %zu\n fast scratch %p %zu\n " ,
205
+ " Running program data:\n cmd %p %zu\n weight %p %zu\n scratch %p %zu\n fast scratch %p %zu\n " ,
199
206
handles.cmd_data ,
200
207
handles.cmd_data_size ,
201
208
handles.weight_data ,
@@ -301,7 +308,7 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
301
308
std::unique_ptr<ethosu_driver, decltype (ðosu_release_driver)>(
302
309
ethosu_reserve_driver (), ethosu_release_driver);
303
310
if (driver == NULL ) {
304
- ET_LOG (Error, " EthosUBackend::execute: ethosu_reserve_driver failed" );
311
+ ET_LOG (Error, " ethosu_reserve_driver failed" );
305
312
return Error::InvalidState;
306
313
}
307
314
@@ -333,10 +340,7 @@ class EthosUBackend final : public ::executorch::runtime::BackendInterface {
333
340
EXECUTORCH_PROF_END (event_tracer, event_tracer_local_scope);
334
341
335
342
if (result != 0 ) {
336
- ET_LOG (
337
- Error,
338
- " EthosUBackend::execute: Ethos-U invocation failed error (%d)" ,
339
- result);
343
+ ET_LOG (Error, " Ethos-U invocation failed error (%d)" , result);
340
344
return Error::InvalidProgram;
341
345
}
342
346
int tensor_dim = 0 , io_dim = 0 ;
0 commit comments