From 01113fbb6d8a586137859770e1715dc443a5cfa0 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Wed, 11 Dec 2019 11:17:55 -0800 Subject: [PATCH] Add gemmlowp to deps if profiling enabled with --copt=-DGEMMLOWP_PROFILING PiperOrigin-RevId: 285023739 Change-Id: Iff889201d7137f2ef7088a2cd831c0fcc4bd8d14 --- tensorflow/lite/BUILD | 7 +++++++ tensorflow/lite/kernels/internal/BUILD | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tensorflow/lite/BUILD b/tensorflow/lite/BUILD index 84150546353..20db9aecba6 100644 --- a/tensorflow/lite/BUILD +++ b/tensorflow/lite/BUILD @@ -15,6 +15,13 @@ exports_files(glob([ "models/testdata/*", ])) +config_setting( + name = "gemmlowp_profiling", + values = { + "copt": "-DGEMMLOWP_PROFILING", + }, +) + config_setting( name = "mips", values = { diff --git a/tensorflow/lite/kernels/internal/BUILD b/tensorflow/lite/kernels/internal/BUILD index 89e87c2700f..3f6b38ce79b 100644 --- a/tensorflow/lite/kernels/internal/BUILD +++ b/tensorflow/lite/kernels/internal/BUILD @@ -51,9 +51,10 @@ cc_library( name = "scoped_profiling_label_wrapper", hdrs = ["scoped_profiling_label_wrapper.h"], copts = tflite_copts(), - # TODO(b/145820877): Add in a select statement once we can figure out a way - # to make it play nicely with copybara. - deps = ["@gemmlowp//:profiler"], + deps = select({ + "//tensorflow/lite:gemmlowp_profiling": ["@gemmlowp//:profiler"], + "//conditions:default": [], + }), ) cc_library(