Skip to content

Commit 3a1fba7

Browse files
authored
build_variables.bzl: make MPS_BACKEND_SRCS usable in BUCK (#13355)
Making the structure in this file mirror buck's worldview more closely when it makes sense. #8268 Differential Revision: [D80187449](https://our.internmc.facebook.com/intern/diff/D80187449)
1 parent 796dc5d commit 3a1fba7

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

backends/apple/mps/targets.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Provided subject to the LICENSE file in the top level directory.
44
#
55

6+
load("@fbsource//xplat/executorch/build:build_variables.bzl", "MPS_BACKEND_BUCK_SRCS")
67
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
78

89
def define_common_targets(is_xplat = False, platforms = []):
@@ -37,10 +38,7 @@ def define_common_targets(is_xplat = False, platforms = []):
3738
"runtime/*.h",
3839
"runtime/operations/*.h",
3940
]),
40-
"srcs": native.glob([
41-
"runtime/*.mm",
42-
"runtime/operations/*.mm",
43-
]),
41+
"srcs": MPS_BACKEND_BUCK_SRCS,
4442
"visibility": [
4543
"//executorch/backends/apple/...",
4644
"//executorch/examples/...",

shim_et/xplat/executorch/build/build_variables.bzl

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -437,31 +437,33 @@ MPS_EXECUTOR_RUNNER_SRCS = [
437437
"extension/data_loader/file_data_loader.cpp",
438438
]
439439

440-
MPS_BACKEND_SRCS = [
441-
"backends/apple/mps/runtime/MPSBackend.mm",
442-
"backends/apple/mps/runtime/MPSCompiler.mm",
443-
"backends/apple/mps/runtime/MPSDelegateHeader.mm",
444-
"backends/apple/mps/runtime/MPSDevice.mm",
445-
"backends/apple/mps/runtime/MPSExecutor.mm",
446-
"backends/apple/mps/runtime/MPSGraphBuilder.mm",
447-
"backends/apple/mps/runtime/MPSStream.mm",
448-
"backends/apple/mps/runtime/operations/ActivationOps.mm",
449-
"backends/apple/mps/runtime/operations/BinaryOps.mm",
450-
"backends/apple/mps/runtime/operations/ClampOps.mm",
451-
"backends/apple/mps/runtime/operations/ConstantOps.mm",
452-
"backends/apple/mps/runtime/operations/ConvolutionOps.mm",
453-
"backends/apple/mps/runtime/operations/IndexingOps.mm",
454-
"backends/apple/mps/runtime/operations/LinearAlgebra.mm",
455-
"backends/apple/mps/runtime/operations/NormalizationOps.mm",
456-
"backends/apple/mps/runtime/operations/OperationUtils.mm",
457-
"backends/apple/mps/runtime/operations/PadOps.mm",
458-
"backends/apple/mps/runtime/operations/PoolingOps.mm",
459-
"backends/apple/mps/runtime/operations/QuantDequant.mm",
460-
"backends/apple/mps/runtime/operations/RangeOps.mm",
461-
"backends/apple/mps/runtime/operations/ReduceOps.mm",
462-
"backends/apple/mps/runtime/operations/ShapeOps.mm",
463-
"backends/apple/mps/runtime/operations/UnaryOps.mm",
464-
]
440+
MPS_BACKEND_BUCK_SRCS = [
441+
"runtime/MPSBackend.mm",
442+
"runtime/MPSCompiler.mm",
443+
"runtime/MPSDelegateHeader.mm",
444+
"runtime/MPSDevice.mm",
445+
"runtime/MPSExecutor.mm",
446+
"runtime/MPSGraphBuilder.mm",
447+
"runtime/MPSStream.mm",
448+
"runtime/operations/ActivationOps.mm",
449+
"runtime/operations/BinaryOps.mm",
450+
"runtime/operations/ClampOps.mm",
451+
"runtime/operations/ConstantOps.mm",
452+
"runtime/operations/ConvolutionOps.mm",
453+
"runtime/operations/IndexingOps.mm",
454+
"runtime/operations/LinearAlgebra.mm",
455+
"runtime/operations/NormalizationOps.mm",
456+
"runtime/operations/OperationUtils.mm",
457+
"runtime/operations/PadOps.mm",
458+
"runtime/operations/PoolingOps.mm",
459+
"runtime/operations/QuantDequant.mm",
460+
"runtime/operations/RangeOps.mm",
461+
"runtime/operations/ReduceOps.mm",
462+
"runtime/operations/ShapeOps.mm",
463+
"runtime/operations/UnaryOps.mm",
464+
]
465+
466+
MPS_BACKEND_SRCS = ["backends/apple/mps/" + x for x in MPS_BACKEND_BUCK_SRCS]
465467

466468
MPS_SCHEMA_SRCS = [
467469
"backends/apple/mps/serialization/schema.fbs",

0 commit comments

Comments
 (0)