Fix compilation error on x86 (#6964)

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
Livius 2021-05-14 07:31:49 +02:00 committed by GitHub
parent f94f479358
commit a4886c404a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -734,8 +734,9 @@ XGB_DLL int XGBoosterPredictFromCSR(BoosterHandle handle, char const *indptr,
API_BEGIN();
CHECK_HANDLE();
std::shared_ptr<xgboost::data::CSRArrayAdapter> x{
new xgboost::data::CSRArrayAdapter{
StringView{indptr}, StringView{indices}, StringView{data}, cols}};
new xgboost::data::CSRArrayAdapter{StringView{indptr},
StringView{indices}, StringView{data},
static_cast<size_t>(cols)}};
std::shared_ptr<DMatrix> p_m {nullptr};
if (m) {
p_m = *static_cast<std::shared_ptr<DMatrix> *>(m);

View File

@ -231,7 +231,7 @@ void GBTree::DoBoost(DMatrix* p_fmat,
: in_gpair->DeviceIdx();
auto out = MatrixView<float>(
&predt->predictions,
{p_fmat->Info().num_row_, static_cast<size_t>(ngroup)}, device);
{static_cast<size_t>(p_fmat->Info().num_row_), static_cast<size_t>(ngroup)}, device);
CHECK_NE(ngroup, 0);
if (ngroup == 1) {
std::vector<std::unique_ptr<RegTree>> ret;