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

Function PD_PString_ToInternalSizeT

paddle/phi/common/cpstring_impl.h:170–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170HOSTDEVICE static inline size_t PD_PString_ToInternalSizeT(
171 size_t size, PD_PString_Type type) {
172#if PD_PSTRING_LITTLE_ENDIAN
173 return (size << 2) | type;
174#else // PD_PSTRING_LITTLE_ENDIAN
175 // 0xFF000000 or 0xFF00000000000000 depending on platform
176 static const size_t mask = ~((~(size_t)0) >> 8); // NOLINT
177
178 return (mask & (size << 2)) | (~mask & size) |
179 ((size_t)type << ((sizeof(size_t) - 1) * 8)); // NOLINT
180#endif // PD_PSTRING_LITTLE_ENDIAN
181}
182
183/*
184 * Need to implement in other source file.

Callers 3

PD_PString_ReserveFunction · 0.85
PD_PString_AssignViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected