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

Function MakeMatrixFromTest

tests/cpp/common/test_linalg.cc:30–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28} // namespace
29
30auto MakeMatrixFromTest(HostDeviceVector<float> *storage, std::size_t n_rows, std::size_t n_cols) {
31 storage->Resize(n_rows * n_cols);
32 auto &h_storage = storage->HostVector();
33
34 std::iota(h_storage.begin(), h_storage.end(), 0);
35
36 auto m = linalg::TensorView<float, 2>{h_storage, {n_rows, static_cast<size_t>(n_cols)}, CPU()};
37 return m;
38}
39
40TEST(Linalg, MatrixView) {
41 size_t kRows = 31, kCols = 77;

Callers 1

TESTFunction · 0.85

Calls 4

CPUFunction · 0.85
ResizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected