From 4265c311d0321d3b4c81a11ae6517312a4bb40a7 Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Tue, 11 Feb 2025 16:28:50 -0800 Subject: [PATCH] Update [ghstack-poisoned] --- build/build_variables.bzl | 15 +++++++++------ runtime/executor/targets.bzl | 7 ++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/build_variables.bzl b/build/build_variables.bzl index 3bd0b8028ef..d9ac0f40e3d 100644 --- a/build/build_variables.bzl +++ b/build/build_variables.bzl @@ -12,17 +12,20 @@ EXECUTORCH_SRCS = [ "kernels/prim_ops/register_prim_ops.cpp", ] -EXECUTORCH_CORE_SRCS = [ +PROGRAM_NO_PRIM_OPS_SRCS = [ + "method.cpp", + "method_meta.cpp", + "program.cpp", + "tensor_parser_exec_aten.cpp", +] + +EXECUTORCH_CORE_SRCS = sorted([ "runtime/backend/interface.cpp", "runtime/core/evalue.cpp", "runtime/core/exec_aten/util/tensor_shape_to_c_string.cpp", "runtime/core/exec_aten/util/tensor_util_portable.cpp", "runtime/core/portable_type/tensor_impl.cpp", "runtime/core/tag.cpp", - "runtime/executor/method.cpp", - "runtime/executor/method_meta.cpp", - "runtime/executor/program.cpp", - "runtime/executor/tensor_parser_exec_aten.cpp", "runtime/executor/tensor_parser_portable.cpp", "runtime/kernel/operator_registry.cpp", "runtime/platform/abort.cpp", @@ -31,7 +34,7 @@ EXECUTORCH_CORE_SRCS = [ "runtime/platform/profiler.cpp", "runtime/platform/runtime.cpp", "schema/extended_header.cpp", -] +] + ["runtime/executor/" + x for x in PROGRAM_NO_PRIM_OPS_SRCS]) PORTABLE_KERNELS_SRCS = [ "kernels/portable/cpu/op__empty_dim_order.cpp", diff --git a/runtime/executor/targets.bzl b/runtime/executor/targets.bzl index 158da5d1087..46734b5c686 100644 --- a/runtime/executor/targets.bzl +++ b/runtime/executor/targets.bzl @@ -1,3 +1,4 @@ +load("@fbsource//xplat/executorch/build:build_variables.bzl", "PROGRAM_NO_PRIM_OPS_SRCS") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") def _program_preprocessor_flags(): @@ -58,11 +59,7 @@ def define_common_targets(): runtime.cxx_library( name = "program_no_prim_ops" + aten_suffix, - srcs = [ - "method.cpp", - "method_meta.cpp", - "program.cpp", - "tensor_parser_exec_aten.cpp", + srcs = PROGRAM_NO_PRIM_OPS_SRCS + [ "tensor_parser{}.cpp".format(aten_suffix if aten_mode else "_portable"), ], headers = [