Skip to content

Commit

Permalink
Merge branch '6021-fix_single_row_contention_v4' into 6021-fix_single…
Browse files Browse the repository at this point in the history
…_row_contention
  • Loading branch information
Ten0 committed Jan 12, 2024
2 parents 6db33b3 + 1a4f1aa commit bf5fc5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
3 changes: 3 additions & 0 deletions src/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,9 @@ int LGBM_BoosterCalcNumPredict(BoosterHandle handle,

// TODO in future versions of LightGBM, public API named around `FastConfig` should be made named around
// `SingleRowPredictor`, because it is specific to single row prediction, and doesn't actually hold only config.
// At the same time, one should consider removing the old non-fast single row public API that stores its Predictor
// in the Booster, because that will enable removing these Predictors from the Booster, and associated initialization
// code.
int LGBM_FastConfigFree(FastConfigHandle fastConfig) {
API_BEGIN();
delete reinterpret_cast<SingleRowPredictor*>(fastConfig);
Expand Down
13 changes: 0 additions & 13 deletions tests/cpp_tests/test_single_row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@

#include <gtest/gtest.h>
#include <testutils.h>
#include <LightGBM/utils/byte_buffer.h>
#include <LightGBM/utils/log.h>
#include <LightGBM/c_api.h>
#include <LightGBM/dataset.h>

#include <iostream>
#include <fstream>

using LightGBM::ByteBuffer;
using LightGBM::Dataset;
using LightGBM::Log;
using LightGBM::TestUtils;

TEST(SingleRow, JustWorks) {
Expand All @@ -26,10 +20,6 @@ TEST(SingleRow, JustWorks) {
result = TestUtils::LoadDatasetFromExamples("binary_classification/binary.train", "max_bin=15", &train_dataset);
EXPECT_EQ(0, result) << "LoadDatasetFromExamples train result code: " << result;

DatasetHandle test_dataset;
result = TestUtils::LoadDatasetFromExamples("binary_classification/binary.test", "max_bin=15", &test_dataset);
EXPECT_EQ(0, result) << "LoadDatasetFromExamples test result code: " << result;

BoosterHandle booster_handle;
result = LGBM_BoosterCreate(train_dataset, "app=binary metric=auc num_leaves=31 verbose=0", &booster_handle);
EXPECT_EQ(0, result) << "LGBM_BoosterCreate result code: " << result;
Expand Down Expand Up @@ -150,7 +140,4 @@ TEST(SingleRow, JustWorks) {

result = LGBM_DatasetFree(train_dataset);
EXPECT_EQ(0, result) << "LGBM_DatasetFree result code: " << result;

result = LGBM_DatasetFree(test_dataset);
EXPECT_EQ(0, result) << "LGBM_DatasetFree result code: " << result;
}

0 comments on commit bf5fc5f

Please sign in to comment.