Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tsl/platform/bfloat16.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/casts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -28,4 +28,4 @@ limitations under the License.
#error Define the appropriate PLATFORM_<foo> macro for this platform
#endif

#endif // TENSORFLOW_TSL_PLATFORM_CASTS_H_
#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CASTS_H_
6 changes: 3 additions & 3 deletions tsl/platform/cord.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -23,4 +23,4 @@ limitations under the License.

#endif // __CUDACC__

#endif // TENSORFLOW_TSL_PLATFORM_CORD_H_
#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_CORD_H_
6 changes: 3 additions & 3 deletions tsl/platform/ctstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/ctstring_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <limits.h>
#include <stdbool.h> // IWYU pragma: keep, provides bool
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stddef.h>
#include <stdint.h>
Expand Down Expand Up @@ -135,4 +135,4 @@ struct hash<tsl::tstring> {
};
} // namespace std

#endif // TENSORFLOW_TSL_PLATFORM_HASH_H_
#endif // THIRD_PARTY_TENSORFLOW_TSL_PLATFORM_HASH_H_
6 changes: 3 additions & 3 deletions tsl/platform/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/ml_dtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_
11 changes: 6 additions & 5 deletions tsl/platform/mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <chrono> // NOLINT
#include <cstdint> // NOLINT
Expand All @@ -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 {

Expand Down Expand Up @@ -189,7 +190,7 @@ class ABSL_DEPRECATED("Use absl::CondVar instead.") condition_variable {
template <class Predicate>
void wait(mutex_lock& lock, Predicate stop_waiting) {
while (!stop_waiting()) {
wait(lock);
wait(mref(lock));
}
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>

Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <array>
#include <cstddef>
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/protobuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -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_
9 changes: 5 additions & 4 deletions tsl/platform/refcount.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <atomic>
#include <map>
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/statusor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
6 changes: 3 additions & 3 deletions tsl/platform/str_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstdint>
#include <string>
Expand Down Expand Up @@ -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_
Loading
Loading