MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BitWidth

Function BitWidth

tensorflow/compiler/xla/primitive_util.cc:60–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int BitWidth(PrimitiveType type) {
61 switch (type) {
62 case PRED:
63 return 1;
64
65 case S8:
66 case U8:
67 return 8;
68
69 case S16:
70 case U16:
71 case F16:
72 case BF16:
73 return 16;
74
75 case U32:
76 case S32:
77 case F32:
78 return 32;
79
80 case U64:
81 case S64:
82 case F64:
83 case C64:
84 return 64;
85
86 case C128:
87 return 128;
88
89 case TUPLE:
90 LOG(FATAL) << "TUPLE is an invalid type for BitWidth";
91
92 case OPAQUE_TYPE:
93 LOG(FATAL) << "OPAQUE_TYPE is an invalid type for BitWidth";
94
95 default:
96 LOG(FATAL) << "Unhandled primitive type " << type;
97 }
98}
99
100xla::PrimitiveType UnsignedIntegralTypeForBitWidth(int64 src_bitwidth) {
101 switch (src_bitwidth) {

Callers 15

CompileMethod · 0.85
CompileMethod · 0.85
ElementHasBitWidthMethod · 0.85
BitcastConvertMethod · 0.85
NextAfterFunction · 0.85
HandleBatchGroupCountMethod · 0.85
EmitIntegerUnaryOpMethod · 0.85
EmitFloatUnaryOpMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected