Skip to content

Commit fa6d938

Browse files
[NFC] Delete platform specific TSL casts libraries (part 1).
PiperOrigin-RevId: 898925115
1 parent 333fbc2 commit fa6d938

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

tsl/platform/BUILD

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,7 @@ cc_library(
955955
hdrs = ["casts.h"],
956956
deps = [
957957
":platform",
958-
"@com_google_absl//absl/base",
959-
],
958+
] + tf_platform_deps("casts"),
960959
)
961960

962961
cc_library(

tsl/platform/casts.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ limitations under the License.
1616
#ifndef TENSORFLOW_TSL_PLATFORM_CASTS_H_
1717
#define TENSORFLOW_TSL_PLATFORM_CASTS_H_
1818

19-
#include "absl/base/casts.h"
2019
#include "tsl/platform/platform.h"
2120

22-
namespace tensorflow {
23-
using ::absl::down_cast;
24-
}
25-
26-
namespace tsl {
27-
using ::absl::down_cast;
28-
}
21+
#if defined(PLATFORM_GOOGLE)
22+
#include "xla/tsl/platform/google/casts.h" // IWYU pragma: export
23+
#elif defined(PLATFORM_POSIX) || defined(PLATFORM_POSIX_ANDROID) || \
24+
defined(PLATFORM_GOOGLE_ANDROID) || defined(PLATFORM_POSIX_IOS) || \
25+
defined(PLATFORM_GOOGLE_IOS) || defined(PLATFORM_WINDOWS)
26+
#include "xla/tsl/platform/default/casts.h" // IWYU pragma: export
27+
#else
28+
#error Define the appropriate PLATFORM_<foo> macro for this platform
29+
#endif
2930

3031
#endif // TENSORFLOW_TSL_PLATFORM_CASTS_H_

0 commit comments

Comments
 (0)