Skip to content

Commit

Permalink
add zero buffer check to SetIndexData()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Razdoburdin committed Nov 17, 2023
1 parent f3a3d85 commit 1caf052
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugin/sycl/common/hist_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void GHistIndexMatrix::SetIndexData(::sycl::queue qu,
size_t nbins,
size_t row_stride,
uint32_t* offsets) {
if (hit_count.size() == 0) return 0;
const xgboost::Entry *data_ptr = dmat_device.data.DataConst();
const bst_row_t *offset_vec = dmat_device.row_ptr.DataConst();
const size_t num_rows = dmat_device.row_ptr.Size() - 1;
Expand Down
2 changes: 1 addition & 1 deletion plugin/sycl/tree/updater_quantile_hist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ bool QuantileHistMaker::Builder<GradientSumT>::UpdatePredictionCache(

const size_t stride = out_preds.Stride(0);
const int buffer_size = out_preds.Size()*stride - stride + 1;
if (buffer_size == 0) return;
if (buffer_size == 0) return true;
::sycl::buffer<float, 1> out_preds_buf(&out_preds(0), buffer_size);

size_t n_nodes = row_set_collection_.Size();
Expand Down

0 comments on commit 1caf052

Please sign in to comment.