MCPcopy Create free account
hub / github.com/catboost/catboost / GenerateQueryDocsOrder

Function GenerateQueryDocsOrder

catboost/cuda/data/data_utils.h:50–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49 template <class TIndicesType>
50 inline void GenerateQueryDocsOrder(ui64 seed, ui32 blockSize, TConstArrayRef<TGroupBounds> groupBounds, TVector<TIndicesType>* orderPtr) {
51 TVector<ui32> order;
52 Shuffle(seed, blockSize, groupBounds.size(), &order);
53 auto& docwiseOrder = *orderPtr;
54 // we assume groupBounds are sorted in ascending order
55 docwiseOrder.yresize(groupBounds.back().End);
56
57 ui32 cursor = 0;
58 for (ui32 groupId = 0; groupId < order.size(); ++groupId) {
59 const auto group = groupBounds[order[groupId]];
60 std::iota(docwiseOrder.begin() + cursor, docwiseOrder.begin() + cursor + group.GetSize(), group.Begin);
61 cursor += group.GetSize();
62 }
63 Y_ASSERT(cursor == docwiseOrder.size());
64 }
65
66 // TODO(kirillovs): this function is used only for cuda unittests, maybe remove later
67 template <class TIndicesType>

Callers 2

QueryConsistentShuffleFunction · 0.85
FillOrderMethod · 0.85

Calls 6

yresizeMethod · 0.80
ShuffleFunction · 0.70
sizeMethod · 0.45
backMethod · 0.45
beginMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected