/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/tpu/kernels/tpu_compilation_cache_metrics.h"

namespace tensorflow {
namespace tpu {

// TODO(henrytan): remove this once `TpuCompilationCache` migration to OSS is
// completed.
#if defined(LIBTFTPU)
/* static */
void TpuCompilationCacheMetrics::IncrementCacheLookupCount(
    bool is_cache_hit, absl::string_view session_name) {
  // A placeholder for tracking metrics.
}

/* static */
void TpuCompilationCacheMetrics::SetCacheEntryCount(int64 count) {
  // A placeholder for tracking metrics.
}
#endif  // LIBTFTPU

}  // namespace tpu
}  // namespace tensorflow

/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/tpu/kernels/tpu_compilation_cache_metrics.h"

namespace tensorflow {
namespace tpu {

/* static */
void TpuCompilationCacheMetrics::IncrementCacheLookupCount(
    bool is_cache_hit, absl::string_view session_name) {
  // A placeholder for tracking metrics.
}

/* static */
void TpuCompilationCacheMetrics::SetCacheEntryCount(int64 count) {
  // A placeholder for tracking metrics.
}

}  // namespace tpu
}  // namespace tensorflow

--- 
+++ 
@@ -17,6 +17,9 @@
 namespace tensorflow {
 namespace tpu {
 
+// TODO(henrytan): remove this once `TpuCompilationCache` migration to OSS is
+// completed.
+#if defined(LIBTFTPU)
 /* static */
 void TpuCompilationCacheMetrics::IncrementCacheLookupCount(
     bool is_cache_hit, absl::string_view session_name) {
@@ -27,6 +30,7 @@
 void TpuCompilationCacheMetrics::SetCacheEntryCount(int64 count) {
   // A placeholder for tracking metrics.
 }
+#endif  // LIBTFTPU
 
 }  // namespace tpu
 }  // namespace tensorflow
Add LIBTFTPU macro qualifier to the definition of the TpuCompilationCacheMetrics.

PiperOrigin-RevId: 319157570
Change-Id: I0ee8c7036ec37eaba0cf661e5448c5cbc599d6df
