MCPcopy Create free account
hub / github.com/dmlc/xgboost / TEST

Function TEST

tests/cpp/common/test_threading_utils.cc:13–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12namespace xgboost::common {
13TEST(ParallelFor2d, CreateBlockedSpace2d) {
14 constexpr size_t kDim1 = 5;
15 constexpr size_t kDim2 = 3;
16 constexpr size_t kGrainSize = 1;
17
18 BlockedSpace2d space(
19 kDim1, [&](size_t) { return kDim2; }, kGrainSize);
20
21 ASSERT_EQ(kDim1 * kDim2, space.Size());
22
23 for (size_t i = 0; i < kDim1; i++) {
24 for (size_t j = 0; j < kDim2; j++) {
25 ASSERT_EQ(space.GetFirstDimension(i*kDim2 + j), i);
26 ASSERT_EQ(j, space.GetRange(i*kDim2 + j).begin());
27 ASSERT_EQ(j + kGrainSize, space.GetRange(i*kDim2 + j).end());
28 }
29 }
30}
31
32TEST(ParallelFor2d, Test) {
33 constexpr size_t kDim1 = 100;

Callers

nothing calls this directly

Calls 11

ParallelFor2dFunction · 0.85
ParallelForFunction · 0.85
OmpGetNumThreadsFunction · 0.85
GetFirstDimensionMethod · 0.80
GetRangeMethod · 0.80
ThreadsMethod · 0.80
resizeMethod · 0.80
SizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
UpdateAllowUnknownMethod · 0.45

Tested by

no test coverage detected