Skip to content

Commit e40b7b1

Browse files
ddunlcopybara-github
authored andcommitted
Create shim targets for most commonly used TSL headers in preparation for updating users
PiperOrigin-RevId: 707667247
1 parent dbb2be9 commit e40b7b1

37 files changed

+74
-8190
lines changed

tsl/platform/BUILD

Lines changed: 32 additions & 197 deletions
Large diffs are not rendered by default.

tsl/platform/env.cc

Lines changed: 0 additions & 649 deletions
This file was deleted.

tsl/platform/env.h

Lines changed: 2 additions & 718 deletions
Large diffs are not rendered by default.

tsl/platform/env_time.h

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
1+
/* Copyright 2024 The TensorFlow Authors. All Rights Reserved.
22
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -12,54 +12,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
==============================================================================*/
15+
1516
#ifndef TENSORFLOW_TSL_PLATFORM_ENV_TIME_H_
1617
#define TENSORFLOW_TSL_PLATFORM_ENV_TIME_H_
1718

18-
#include <stdint.h>
19-
20-
#include "tsl/platform/types.h"
21-
22-
namespace tsl {
23-
24-
/// \brief An interface used by the tsl implementation to
25-
/// access timer related operations.
26-
class EnvTime {
27-
public:
28-
static constexpr uint64 kMicrosToPicos = 1000ULL * 1000ULL;
29-
static constexpr uint64 kMicrosToNanos = 1000ULL;
30-
static constexpr uint64 kMillisToMicros = 1000ULL;
31-
static constexpr uint64 kMillisToNanos = 1000ULL * 1000ULL;
32-
static constexpr uint64 kNanosToPicos = 1000ULL;
33-
static constexpr uint64 kSecondsToMillis = 1000ULL;
34-
static constexpr uint64 kSecondsToMicros = 1000ULL * 1000ULL;
35-
static constexpr uint64 kSecondsToNanos = 1000ULL * 1000ULL * 1000ULL;
36-
37-
EnvTime() = default;
38-
virtual ~EnvTime() = default;
39-
40-
/// \brief Returns the number of nano-seconds since the Unix epoch.
41-
static uint64 NowNanos();
42-
43-
/// \brief Returns the number of micro-seconds since the Unix epoch.
44-
static uint64 NowMicros() { return NowNanos() / kMicrosToNanos; }
45-
46-
/// \brief Returns the number of seconds since the Unix epoch.
47-
static uint64 NowSeconds() { return NowNanos() / kSecondsToNanos; }
48-
49-
/// \brief A version of NowNanos() that may be overridden by a subclass.
50-
virtual uint64 GetOverridableNowNanos() const { return NowNanos(); }
51-
52-
/// \brief A version of NowMicros() that may be overridden by a subclass.
53-
virtual uint64 GetOverridableNowMicros() const {
54-
return GetOverridableNowNanos() / kMicrosToNanos;
55-
}
56-
57-
/// \brief A version of NowSeconds() that may be overridden by a subclass.
58-
virtual uint64 GetOverridableNowSeconds() const {
59-
return GetOverridableNowNanos() / kSecondsToNanos;
60-
}
61-
};
62-
63-
} // namespace tsl
19+
#include "xla/tsl/platform/env_time.h"
6420

6521
#endif // TENSORFLOW_TSL_PLATFORM_ENV_TIME_H_

tsl/platform/errors.cc

Lines changed: 0 additions & 249 deletions
This file was deleted.

0 commit comments

Comments
 (0)