From eaeca82b76bdaca89c2411cbec97dd3a346e3c44 Mon Sep 17 00:00:00 2001 From: Yuqi Li Date: Tue, 13 Jun 2023 18:39:14 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 540134258 --- mediapipe/util/cpu_util.cc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/mediapipe/util/cpu_util.cc b/mediapipe/util/cpu_util.cc index 052eabb85..74e6debd5 100644 --- a/mediapipe/util/cpu_util.cc +++ b/mediapipe/util/cpu_util.cc @@ -26,7 +26,6 @@ #include #include "absl/algorithm/container.h" -#include "absl/flags/flag.h" #include "absl/strings/match.h" #include "absl/strings/numbers.h" #include "absl/strings/str_cat.h" @@ -35,23 +34,14 @@ #include "mediapipe/framework/port/integral_types.h" #include "mediapipe/framework/port/statusor.h" -ABSL_FLAG(std::string, system_cpu_max_freq_file, - "/sys/devices/system/cpu/cpu$0/cpufreq/cpuinfo_max_freq", - "The file pattern for CPU max frequencies, where $0 will be replaced " - "with the CPU id."); - namespace mediapipe { namespace { constexpr uint32_t kBufferLength = 64; absl::StatusOr GetFilePath(int cpu) { - if (!absl::StrContains(absl::GetFlag(FLAGS_system_cpu_max_freq_file), "$0")) { - return absl::InvalidArgumentError( - absl::StrCat("Invalid frequency file: ", - absl::GetFlag(FLAGS_system_cpu_max_freq_file))); - } - return absl::Substitute(absl::GetFlag(FLAGS_system_cpu_max_freq_file), cpu); + return absl::Substitute( + "/sys/devices/system/cpu/cpu$0/cpufreq/cpuinfo_max_freq", cpu); } absl::StatusOr GetCpuMaxFrequency(int cpu) {