MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / PD_PString_GetSize

Function PD_PString_GetSize

paddle/phi/common/cpstring_impl.h:275–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275HOSTDEVICE static inline size_t PD_PString_GetSize(const PD_PString *str) {
276 switch (PD_PString_GetType(str)) {
277 case PD_PSTR_SMALL:
278 return str->u.small.size >> 2;
279 case PD_PSTR_LARGE:
280 return PD_PString_ToActualSizeT(str->u.large.size);
281 case PD_PSTR_OFFSET:
282 return PD_le32toh(str->u.offset.size) >> 2;
283 case PD_PSTR_VIEW:
284 return PD_PString_ToActualSizeT(str->u.view.size);
285 default:
286 return 0; // Unreachable.
287 }
288}
289
290HOSTDEVICE static inline size_t PD_PString_GetCapacity(const PD_PString *str) {
291 switch (PD_PString_GetType(str)) {

Callers 9

PD_PString_ReserveFunction · 0.85
PD_PString_ResizeFunction · 0.85
PD_PString_AppendNFunction · 0.85
PD_PString_AppendFunction · 0.85
PD_PString_AssignFunction · 0.85
PD_PString_MoveFunction · 0.85
sizeMethod · 0.85

Calls 1

PD_PString_ToActualSizeTFunction · 0.85

Tested by

no test coverage detected