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

Method compare

paddle/phi/common/pstring.h:233–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231// Comparison
232
233HOSTDEVICE inline int pstring::compare(const char* str, size_t len) const {
234 int ret = PD_Memcmp(data(), str, (len < size()) ? len : size());
235
236 if (ret < 0) return -1;
237 if (ret > 0) return +1;
238
239 if (size() < len) return -1;
240 if (size() > len) return +1;
241
242 return 0;
243}
244
245HOSTDEVICE inline bool pstring::operator<(const pstring& o) const {
246 return compare(o.data(), o.size()) < 0;

Callers 15

consumeKeywordMethod · 0.45
consumeLiteralMethod · 0.45
consumeLiteralMethod · 0.45
CallMethod · 0.45
IsGradOpFunction · 0.45
StringHasEndingFunction · 0.45
ParseDeviceContextFunction · 0.45
AnalyseOpFuncTypeFunction · 0.45
GradNodePyLayerMethod · 0.45
GenerateOpFunctionsFunction · 0.45
BindImperativeFunction · 0.45

Calls 3

PD_MemcmpFunction · 0.85
dataFunction · 0.50
sizeFunction · 0.50

Tested by

no test coverage detected