MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / LGBM_DatasetPushRows

Function LGBM_DatasetPushRows

src/c_api.cpp:538–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538int LGBM_DatasetPushRows(DatasetHandle dataset,
539 const void* data,
540 int data_type,
541 int32_t nrow,
542 int32_t ncol,
543 int32_t start_row) {
544 API_BEGIN();
545 auto p_dataset = reinterpret_cast<Dataset*>(dataset);
546 auto get_row_fun = RowFunctionFromDenseMatric(data, nrow, ncol, data_type, 1);
547 OMP_INIT_EX();
548 #pragma omp parallel for schedule(static)
549 for (int i = 0; i < nrow; ++i) {
550 OMP_LOOP_EX_BEGIN();
551 const int tid = omp_get_thread_num();
552 auto one_row = get_row_fun(i);
553 p_dataset->PushOneRow(tid, start_row + i, one_row);
554 OMP_LOOP_EX_END();
555 }
556 OMP_THROW_EX();
557 if (start_row + nrow == p_dataset->num_data()) {
558 p_dataset->FinishLoad();
559 }
560 API_END();
561}
562
563int LGBM_DatasetPushRowsByCSR(DatasetHandle dataset,
564 const void* indptr,

Callers

nothing calls this directly

Calls 5

omp_get_thread_numFunction · 0.50
PushOneRowMethod · 0.45
num_dataMethod · 0.45
FinishLoadMethod · 0.45

Tested by

no test coverage detected