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

Function PD_PString_GetDataPointer

paddle/phi/common/cpstring_impl.h:303–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303HOSTDEVICE static inline const char *PD_PString_GetDataPointer(
304 const PD_PString *str) {
305 switch (PD_PString_GetType(str)) {
306 case PD_PSTR_SMALL:
307 return str->u.small.str;
308 case PD_PSTR_LARGE:
309 return str->u.large.ptr;
310 case PD_PSTR_OFFSET:
311 return (const char *)str + str->u.offset.offset; // NOLINT
312 case PD_PSTR_VIEW:
313 return str->u.view.ptr;
314 default:
315 // Unreachable.
316 return NULL; // NOLINT
317 }
318}
319
320HOSTDEVICE static inline char *PD_PString_ResizeUninitialized(PD_PString *str,
321 size_t new_size) {

Callers 6

PD_PString_ReserveFunction · 0.85
PD_PString_AppendFunction · 0.85
PD_PString_AssignFunction · 0.85
PD_PString_MoveFunction · 0.85
dataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected