From 08ebc6d02809e5c40f0d0f6d61b0567d978ccb2c Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 9 Apr 2026 12:07:13 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 897235190 --- tsl/platform/bfloat16.h | 6 ++--- tsl/platform/casts.h | 6 ++--- tsl/platform/cord.h | 6 ++--- tsl/platform/ctstring.h | 6 ++--- tsl/platform/ctstring_internal.h | 6 ++--- tsl/platform/errors.h | 6 ++--- tsl/platform/hash.h | 6 ++--- tsl/platform/logging.h | 6 ++--- tsl/platform/macros.h | 6 ++--- tsl/platform/mem.h | 6 ++--- tsl/platform/ml_dtypes.h | 6 ++--- tsl/platform/mutex.h | 11 +++++---- tsl/platform/numa.h | 6 ++--- tsl/platform/numbers.h | 6 ++--- tsl/platform/platform.h | 6 ++--- tsl/platform/protobuf.h | 6 ++--- tsl/platform/refcount.h | 9 ++++---- tsl/platform/status.h | 6 ++--- tsl/platform/statusor.h | 6 ++--- tsl/platform/str_util.h | 6 ++--- tsl/platform/strcat.h | 38 +++++++++++++++---------------- tsl/platform/stringpiece.h | 6 ++--- tsl/platform/thread_annotations.h | 6 ++--- tsl/platform/tstring.h | 15 ++++++------ 24 files changed, 98 insertions(+), 95 deletions(-) diff --git a/tsl/platform/bfloat16.h b/tsl/platform/bfloat16.h index daf5e93ec..bbbb30e58 100644 --- a/tsl/platform/bfloat16.h +++ b/tsl/platform/bfloat16.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_BFLOAT16_H_ -#define TENSORFLOW_TSL_PLATFORM_BFLOAT16_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_BFLOAT16_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_BFLOAT16_H_ // clang-format off #include "Eigen/Core" // from @eigen_archive @@ -24,4 +24,4 @@ namespace tsl { typedef Eigen::bfloat16 bfloat16; } // end namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_BFLOAT16_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_BFLOAT16_H_ diff --git a/tsl/platform/casts.h b/tsl/platform/casts.h index 8ec9f78e8..914e854c8 100644 --- a/tsl/platform/casts.h +++ b/tsl/platform/casts.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_CASTS_H_ -#define TENSORFLOW_TSL_PLATFORM_CASTS_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CASTS_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CASTS_H_ #include "tsl/platform/platform.h" @@ -28,4 +28,4 @@ limitations under the License. #error Define the appropriate PLATFORM_ macro for this platform #endif -#endif // TENSORFLOW_TSL_PLATFORM_CASTS_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CASTS_H_ diff --git a/tsl/platform/cord.h b/tsl/platform/cord.h index cb1233f57..b75bcbdd9 100644 --- a/tsl/platform/cord.h +++ b/tsl/platform/cord.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_CORD_H_ -#define TENSORFLOW_TSL_PLATFORM_CORD_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CORD_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CORD_H_ // It seems CORD doesn't work well with CUDA <= 10.2 #if !defined(__CUDACC__) || ((defined(__CUDACC__) && CUDA_VERSION > 10020)) @@ -23,4 +23,4 @@ limitations under the License. #endif // __CUDACC__ -#endif // TENSORFLOW_TSL_PLATFORM_CORD_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CORD_H_ diff --git a/tsl/platform/ctstring.h b/tsl/platform/ctstring.h index 0e45c0e86..88c14f113 100644 --- a/tsl/platform/ctstring.h +++ b/tsl/platform/ctstring.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ -#define TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ #include #include @@ -126,4 +126,4 @@ inline void TF_TString_Assign(TF_TString *dst, const TF_TString *src); // inputs. inline void TF_TString_Move(TF_TString *dst, TF_TString *src); -#endif // TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CTSTRING_H_ diff --git a/tsl/platform/ctstring_internal.h b/tsl/platform/ctstring_internal.h index dad9f483b..8679d6909 100644 --- a/tsl/platform/ctstring_internal.h +++ b/tsl/platform/ctstring_internal.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_CTSTRING_INTERNAL_H_ -#define TENSORFLOW_TSL_PLATFORM_CTSTRING_INTERNAL_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CTSTRING_INTERNAL_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CTSTRING_INTERNAL_H_ #include #include // IWYU pragma: keep, provides bool @@ -495,4 +495,4 @@ static inline void TF_TString_Move(TF_TString *dst, TF_TString *src) { } } -#endif // TENSORFLOW_TSL_PLATFORM_CTSTRING_INTERNAL_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CTSTRING_INTERNAL_H_ diff --git a/tsl/platform/errors.h b/tsl/platform/errors.h index 0c28bd418..a0182871d 100644 --- a/tsl/platform/errors.h +++ b/tsl/platform/errors.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_ERRORS_H_ -#define TENSORFLOW_TSL_PLATFORM_ERRORS_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_ERRORS_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_ERRORS_H_ #include "xla/tsl/platform/errors.h" -#endif // TENSORFLOW_TSL_PLATFORM_ERRORS_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_ERRORS_H_ diff --git a/tsl/platform/hash.h b/tsl/platform/hash.h index e27dee187..c0d3b87ea 100644 --- a/tsl/platform/hash.h +++ b/tsl/platform/hash.h @@ -15,8 +15,8 @@ limitations under the License. // Simple hash functions used for internal data structures -#ifndef TENSORFLOW_TSL_PLATFORM_HASH_H_ -#define TENSORFLOW_TSL_PLATFORM_HASH_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_HASH_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_HASH_H_ #include #include @@ -135,4 +135,4 @@ struct hash { }; } // namespace std -#endif // TENSORFLOW_TSL_PLATFORM_HASH_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_HASH_H_ diff --git a/tsl/platform/logging.h b/tsl/platform/logging.h index 193cb9b51..5949fd154 100644 --- a/tsl/platform/logging.h +++ b/tsl/platform/logging.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_LOGGING_H_ -#define TENSORFLOW_TSL_PLATFORM_LOGGING_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_LOGGING_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_LOGGING_H_ #include "xla/tsl/platform/logging.h" -#endif // TENSORFLOW_TSL_PLATFORM_LOGGING_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_LOGGING_H_ diff --git a/tsl/platform/macros.h b/tsl/platform/macros.h index 960d7ed2e..2a0efabf2 100644 --- a/tsl/platform/macros.h +++ b/tsl/platform/macros.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_MACROS_H_ -#define TENSORFLOW_TSL_PLATFORM_MACROS_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MACROS_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MACROS_H_ #include "xla/tsl/platform/macros.h" -#endif // TENSORFLOW_TSL_PLATFORM_MACROS_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MACROS_H_ diff --git a/tsl/platform/mem.h b/tsl/platform/mem.h index d2b3286f0..6ab7bcc1c 100644 --- a/tsl/platform/mem.h +++ b/tsl/platform/mem.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_MEM_H_ -#define TENSORFLOW_TSL_PLATFORM_MEM_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MEM_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MEM_H_ #include #include @@ -115,4 +115,4 @@ static inline int64_t AvailableRam() { return GetMemoryInfo().free; } } // namespace port } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_MEM_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MEM_H_ diff --git a/tsl/platform/ml_dtypes.h b/tsl/platform/ml_dtypes.h index b536e2f8a..0152ac76a 100644 --- a/tsl/platform/ml_dtypes.h +++ b/tsl/platform/ml_dtypes.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_ML_DTYPES_H_ -#define TENSORFLOW_TSL_PLATFORM_ML_DTYPES_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_ML_DTYPES_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_ML_DTYPES_H_ #include "ml_dtypes/include/float8.h" // from @ml_dtypes_py #include "ml_dtypes/include/intn.h" // from @ml_dtypes_py @@ -39,4 +39,4 @@ using int4 = ::ml_dtypes::int4; using uint4 = ::ml_dtypes::uint4; } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_ML_DTYPES_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_ML_DTYPES_H_ diff --git a/tsl/platform/mutex.h b/tsl/platform/mutex.h index 4163e3edd..8c029e211 100644 --- a/tsl/platform/mutex.h +++ b/tsl/platform/mutex.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_MUTEX_H_ -#define TENSORFLOW_TSL_PLATFORM_MUTEX_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MUTEX_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MUTEX_H_ #include // NOLINT #include // NOLINT @@ -27,6 +27,7 @@ limitations under the License. #include "absl/synchronization/mutex.h" #include "absl/time/time.h" #include "tsl/platform/thread_annotations.h" +#include "waymo/onboard/util/mref.h" namespace tsl { @@ -189,7 +190,7 @@ class ABSL_DEPRECATED("Use absl::CondVar instead.") condition_variable { template void wait(mutex_lock& lock, Predicate stop_waiting) { while (!stop_waiting()) { - wait(lock); + wait(mref(lock)); } } @@ -213,7 +214,7 @@ class ABSL_DEPRECATED("Use absl::CondVar instead.") condition_variable { // return either kCond_Timeout or kCond_MaybeNotified inline ConditionResult WaitForMilliseconds(mutex_lock* mu, condition_variable* cv, int64_t ms) { - std::cv_status s = cv->wait_for(*mu, std::chrono::milliseconds(ms)); + std::cv_status s = cv->wait_for(mref(*mu), std::chrono::milliseconds(ms)); return (s == std::cv_status::timeout) ? kCond_Timeout : kCond_MaybeNotified; } @@ -274,4 +275,4 @@ std::cv_status condition_variable::wait_for( } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_MUTEX_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_MUTEX_H_ diff --git a/tsl/platform/numa.h b/tsl/platform/numa.h index 85d16a4b3..0e90846f2 100644 --- a/tsl/platform/numa.h +++ b/tsl/platform/numa.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_NUMA_H_ -#define TENSORFLOW_TSL_PLATFORM_NUMA_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_NUMA_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_NUMA_H_ #include @@ -58,4 +58,4 @@ int NUMAGetMemAffinity(const void* ptr); } // namespace port } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_NUMA_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_NUMA_H_ diff --git a/tsl/platform/numbers.h b/tsl/platform/numbers.h index 34ba2a629..30329b8f7 100644 --- a/tsl/platform/numbers.h +++ b/tsl/platform/numbers.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_NUMBERS_H_ -#define TENSORFLOW_TSL_PLATFORM_NUMBERS_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_NUMBERS_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_NUMBERS_H_ #include #include @@ -168,4 +168,4 @@ std::string HumanReadableElapsedTime(double seconds); } // namespace strings } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_NUMBERS_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_NUMBERS_H_ diff --git a/tsl/platform/platform.h b/tsl/platform/platform.h index ebc3173d5..602d2ed45 100644 --- a/tsl/platform/platform.h +++ b/tsl/platform/platform.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_PLATFORM_H_ -#define TENSORFLOW_TSL_PLATFORM_PLATFORM_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_PLATFORM_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_PLATFORM_H_ // Set one PLATFORM_* macro and set IS_MOBILE_PLATFORM if the platform is for // mobile. @@ -95,4 +95,4 @@ inline constexpr bool kIsOpenSource = TSL_IS_IN_OSS; } // namespace tsl #endif -#endif // TENSORFLOW_TSL_PLATFORM_PLATFORM_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_PLATFORM_H_ diff --git a/tsl/platform/protobuf.h b/tsl/platform/protobuf.h index 468c94f67..381339ba0 100644 --- a/tsl/platform/protobuf.h +++ b/tsl/platform/protobuf.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_PROTOBUF_H_ -#define TENSORFLOW_TSL_PLATFORM_PROTOBUF_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_PROTOBUF_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_PROTOBUF_H_ #include #include @@ -140,4 +140,4 @@ std::string LegacyUnredactedShortDebugString( const tsl::protobuf::Message& message); } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_PROTOBUF_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_PROTOBUF_H_ diff --git a/tsl/platform/refcount.h b/tsl/platform/refcount.h index 348ba3fe1..a6f1a51bd 100644 --- a/tsl/platform/refcount.h +++ b/tsl/platform/refcount.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_REFCOUNT_H_ -#define TENSORFLOW_TSL_PLATFORM_REFCOUNT_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_REFCOUNT_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_REFCOUNT_H_ #include #include @@ -24,6 +24,7 @@ limitations under the License. #include "absl/synchronization/mutex.h" #include "xla/tsl/platform/logging.h" #include "tsl/platform/thread_annotations.h" +#include "waymo/onboard/util/mref.h" namespace tsl { namespace core { @@ -318,7 +319,7 @@ inline bool RefCounted::TryRef() const { // old_ref == 0, as done in LLVM libstdc++. int_fast32_t old_ref = ref_.load(); while (old_ref != 0) { - if (ref_.compare_exchange_weak(old_ref, old_ref + 1)) { + if (ref_.compare_exchange_weak(mref(old_ref), old_ref + 1)) { return true; } } @@ -354,4 +355,4 @@ inline bool RefCounted::RefCountIsOne() const { } // namespace core } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_REFCOUNT_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_REFCOUNT_H_ diff --git a/tsl/platform/status.h b/tsl/platform/status.h index fdd9343ac..d2e1046b0 100644 --- a/tsl/platform/status.h +++ b/tsl/platform/status.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_STATUS_H_ -#define TENSORFLOW_TSL_PLATFORM_STATUS_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STATUS_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STATUS_H_ #include "xla/tsl/platform/status.h" -#endif // TENSORFLOW_TSL_PLATFORM_STATUS_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STATUS_H_ diff --git a/tsl/platform/statusor.h b/tsl/platform/statusor.h index c4e6da372..e0619c29e 100644 --- a/tsl/platform/statusor.h +++ b/tsl/platform/statusor.h @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_STATUSOR_H_ -#define TENSORFLOW_TSL_PLATFORM_STATUSOR_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STATUSOR_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STATUSOR_H_ #include "xla/tsl/platform/statusor.h" -#endif // TENSORFLOW_TSL_PLATFORM_STATUSOR_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STATUSOR_H_ diff --git a/tsl/platform/str_util.h b/tsl/platform/str_util.h index b27e06803..cbb51dc36 100644 --- a/tsl/platform/str_util.h +++ b/tsl/platform/str_util.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_STR_UTIL_H_ -#define TENSORFLOW_TSL_PLATFORM_STR_UTIL_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STR_UTIL_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STR_UTIL_H_ #include #include @@ -215,4 +215,4 @@ std::string ArgDefCase(absl::string_view s); } // namespace str_util } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_STR_UTIL_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STR_UTIL_H_ diff --git a/tsl/platform/strcat.h b/tsl/platform/strcat.h index a0d3bba31..2d645f585 100644 --- a/tsl/platform/strcat.h +++ b/tsl/platform/strcat.h @@ -17,8 +17,8 @@ limitations under the License. // #category: operations on strings // #summary: Merges strings or numbers with no delimiter. // -#ifndef TENSORFLOW_TSL_PLATFORM_STRCAT_H_ -#define TENSORFLOW_TSL_PLATFORM_STRCAT_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STRCAT_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STRCAT_H_ #include @@ -61,22 +61,22 @@ namespace tsl { namespace strings { using PadSpec ABSL_DEPRECATE_AND_INLINE() = absl::PadSpec; -using absl::kNoPad; -using absl::kZeroPad10; -using absl::kZeroPad11; -using absl::kZeroPad12; -using absl::kZeroPad13; -using absl::kZeroPad14; -using absl::kZeroPad15; -using absl::kZeroPad16; -using absl::kZeroPad2; -using absl::kZeroPad3; -using absl::kZeroPad4; -using absl::kZeroPad5; -using absl::kZeroPad6; -using absl::kZeroPad7; -using absl::kZeroPad8; -using absl::kZeroPad9; +using ::absl::kNoPad; +using ::absl::kZeroPad10; +using ::absl::kZeroPad11; +using ::absl::kZeroPad12; +using ::absl::kZeroPad13; +using ::absl::kZeroPad14; +using ::absl::kZeroPad15; +using ::absl::kZeroPad16; +using ::absl::kZeroPad2; +using ::absl::kZeroPad3; +using ::absl::kZeroPad4; +using ::absl::kZeroPad5; +using ::absl::kZeroPad6; +using ::absl::kZeroPad7; +using ::absl::kZeroPad8; +using ::absl::kZeroPad9; using Hex ABSL_DEPRECATE_AND_INLINE() = absl::Hex; using AlphaNum ABSL_DEPRECATE_AND_INLINE() = absl::AlphaNum; @@ -185,4 +185,4 @@ inline void StrAppend(std::string* dest, const absl::AlphaNum& a, } // namespace strings } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_STRCAT_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STRCAT_H_ diff --git a/tsl/platform/stringpiece.h b/tsl/platform/stringpiece.h index c885f477e..6c7485f3b 100644 --- a/tsl/platform/stringpiece.h +++ b/tsl/platform/stringpiece.h @@ -23,8 +23,8 @@ limitations under the License. // non-const method, all threads accessing the same StringPiece must use // external synchronization. -#ifndef TENSORFLOW_TSL_PLATFORM_STRINGPIECE_H_ -#define TENSORFLOW_TSL_PLATFORM_STRINGPIECE_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STRINGPIECE_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STRINGPIECE_H_ // IWYU pragma: private, include "absl/strings/string_view.h" @@ -37,4 +37,4 @@ using StringPiece ABSL_DEPRECATE_AND_INLINE() = absl::string_view; } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_STRINGPIECE_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_STRINGPIECE_H_ diff --git a/tsl/platform/thread_annotations.h b/tsl/platform/thread_annotations.h index 4f9604d6b..8f57f710d 100644 --- a/tsl/platform/thread_annotations.h +++ b/tsl/platform/thread_annotations.h @@ -32,8 +32,8 @@ limitations under the License. // (e.g. &MyClass::mutex_) to refer to a mutex in some (unknown) object. // -#ifndef TENSORFLOW_TSL_PLATFORM_THREAD_ANNOTATIONS_H_ -#define TENSORFLOW_TSL_PLATFORM_THREAD_ANNOTATIONS_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_THREAD_ANNOTATIONS_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_THREAD_ANNOTATIONS_H_ // IWYU pragma: private, include "tsl/platform/thread_annotations.h" // IWYU pragma: friend third_party/tensorflow/tsl/platform/thread_annotations.h @@ -162,4 +162,4 @@ limitations under the License. // annotations will be ignored by the analysis. #define TF_TS_UNCHECKED(x) "" -#endif // TENSORFLOW_TSL_PLATFORM_THREAD_ANNOTATIONS_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_THREAD_ANNOTATIONS_H_ diff --git a/tsl/platform/tstring.h b/tsl/platform/tstring.h index 97e588bac..02ed96ff5 100644 --- a/tsl/platform/tstring.h +++ b/tsl/platform/tstring.h @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ -#ifndef TENSORFLOW_TSL_PLATFORM_TSTRING_H_ -#define TENSORFLOW_TSL_PLATFORM_TSTRING_H_ +#ifndef THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_TSTRING_H_ +#define THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_TSTRING_H_ #include @@ -29,6 +29,7 @@ limitations under the License. #include "tsl/platform/platform.h" #include "tsl/platform/refcount.h" #include "tsl/platform/stringpiece.h" +#include "waymo/onboard/util/mref.h" namespace tsl { @@ -144,7 +145,7 @@ class tstring { tstring(const char* str, size_t len); tstring(const char* str); // NOLINT TODO(b/147740521): Make explicit. tstring(size_t n, char c); - explicit tstring(const absl::string_view str); + explicit tstring(absl::string_view str); #ifdef PLATFORM_GOOGLE explicit tstring(const absl::Cord& cord); // Zero-copy, holds reference. #endif // PLATFORM_GOOGLE @@ -164,7 +165,7 @@ class tstring { tstring& operator=(std::string&& str); // Zero-copy, takes rvalue ownership. tstring& operator=(const char* str); tstring& operator=(char ch); - tstring& operator=(const absl::string_view str); + tstring& operator=(absl::string_view str); #ifdef PLATFORM_GOOGLE tstring& operator=(const absl::Cord& cord); // Zero-copy, holds reference. #endif // PLATFORM_GOOGLE @@ -232,7 +233,7 @@ class tstring { // View Assignment tstring& assign_as_view(const tstring& str); tstring& assign_as_view(const std::string& str); - tstring& assign_as_view(const absl::string_view str); + tstring& assign_as_view(absl::string_view str); tstring& assign_as_view(const char* str, size_t len); tstring& assign_as_view(const char* str); @@ -671,7 +672,7 @@ inline tstring& tstring::insert(size_t pos, size_t n, char c) { inline void tstring::swap(tstring& str) noexcept { // TODO(dero): Invalid for OFFSET (unimplemented). - std::swap(tstr_, str.tstr_); + std::swap(mref(tstr_), mref(str.tstr_)); } inline void tstring::push_back(char ch) { append(1, ch); } @@ -701,4 +702,4 @@ inline std::ostream& operator<<(std::ostream& o, const tstring& str) { } // namespace tsl -#endif // TENSORFLOW_TSL_PLATFORM_TSTRING_H_ +#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_TSTRING_H_