Skip to content

Commit

Permalink
CPU compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jul 20, 2021
1 parent e8237bf commit 8c1e9dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/data/sparse_page_dmatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,25 @@ MetaInfo &SparsePageDMatrix::Info() { return info_; }
const MetaInfo &SparsePageDMatrix::Info() const { return info_; }

namespace detail {
size_t NSamplesDevice(DMatrixProxy *proxy);
size_t NFeaturesDevice(DMatrixProxy *proxy);
size_t NSamplesDevice(DMatrixProxy *proxy)
#if defined(XGBOOST_USE_CUDA)
; // NOLINT
#else
{
common::AssertGPUSupport();
return 0;
}
#endif
size_t NFeaturesDevice(DMatrixProxy *proxy)
#if defined(XGBOOST_USE_CUDA)
; // NOLINT
#else
{
common::AssertGPUSupport();
return 0;
}
#endif
} // namespace detail


SparsePageDMatrix::SparsePageDMatrix(DataIterHandle iter_handle, DMatrixHandle proxy_handle,
Expand Down
2 changes: 1 addition & 1 deletion src/data/sparse_page_source.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ size_t NSamplesDevice(DMatrixProxy *proxy) {
size_t NFeaturesDevice(DMatrixProxy *proxy) {
return Dispatch(proxy, [](auto const &value) { return value.NumCols(); });
}
}
} // namespace detail

void DevicePush(DMatrixProxy* proxy, float missing, SparsePage* page) {
auto device = proxy->DeviceIdx();
Expand Down

0 comments on commit 8c1e9dd

Please sign in to comment.