From ab4aecbbd1b23e7d23db61825d12f84fb5829e08 Mon Sep 17 00:00:00 2001 From: Chris Thompson Date: Thu, 29 May 2025 11:26:36 -0700 Subject: [PATCH] Add event_tracer to MIL for Backend Init Context (#11105) Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/11105 Allow for intended usage of event tracer in BackendInitContext. Reviewed By: cccclai Differential Revision: D75308778 --- runtime/backend/backend_init_context.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/backend/backend_init_context.h b/runtime/backend/backend_init_context.h index 71c5182f401..5a4b70e0dbc 100644 --- a/runtime/backend/backend_init_context.h +++ b/runtime/backend/backend_init_context.h @@ -25,8 +25,14 @@ class BackendInitContext final { const char* method_name = nullptr, const NamedDataMap* named_data_map = nullptr) : runtime_allocator_(runtime_allocator), +#ifdef ET_EVENT_TRACER_ENABLED + event_tracer_(event_tracer), +#else + event_tracer_(nullptr), +#endif method_name_(method_name), - named_data_map_(named_data_map) {} + named_data_map_(named_data_map) { + } /** Get the runtime allocator passed from Method. It's the same runtime * executor used by the standard executor runtime and the life span is the