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
5 changes: 3 additions & 2 deletions xla/primitive_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
#define XLA_PRIMITIVE_UTIL_H_

#include <array>
#include <climits>
#include <cstdint>
#include <limits>
#include <string>
Expand Down Expand Up @@ -696,7 +697,7 @@ inline constexpr int PrimitiveTypeBitWidth() {
(IsSignedIntegralType(primitive_type) ? 1 : 0);
}
if constexpr (primitive_type == PRED) {
return std::numeric_limits<NativeT>::digits;
return std::numeric_limits<uint8_t>::digits;
}
if constexpr (IsMXType(primitive_type)) {
return NativeT::kBits;
Expand Down Expand Up @@ -770,7 +771,7 @@ inline constexpr int BitWidth(PrimitiveType type) {
// type is not an array type.
inline constexpr int StorageBitWidth(PrimitiveType type) {
if (type == PRED) {
return 8;
return sizeof(bool) * CHAR_BIT;
}
return BitWidth(type);
}
Expand Down
6 changes: 0 additions & 6 deletions xla/tests/bitcast_convert_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ ENTRY main {
}

TEST_F(BitcastConvertHloTest, FourPredToF32) {
if (test::DeviceTypeIs({test::kTpu})) {
GTEST_SKIP();
}
absl::string_view hlo_string = R"(
HloModule bitcast_to_smaller
Expand All @@ -225,9 +222,6 @@ ENTRY main {
ROOT out = pred[10] bitcast-convert(p)
}
)";
if (test::DeviceTypeIs({test::kTpu})) {
GTEST_SKIP();
}
EXPECT_TRUE(RunAndCompare(hlo_string, ErrorSpec{1e-5, 1e-5}));
}

Expand Down
Loading