Skip to content

Commit

Permalink
updates for PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyueXu77 committed Aug 9, 2024
1 parent 563ed7b commit ba82521
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/tree/gpu_hist/histogram.cu
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,16 @@ void DeviceHistogramBuilder::Reset(Context const* ctx, FeatureGroupsAccessor con

struct ReadMatrixFunction {
EllpackDeviceAccessor matrix;
int kCols;
int k_cols;
bst_float* matrix_data_d;
ReadMatrixFunction(EllpackDeviceAccessor matrix, int kCols, bst_float* matrix_data_d)
: matrix(std::move(matrix)), kCols(kCols), matrix_data_d(matrix_data_d) {}
ReadMatrixFunction(EllpackDeviceAccessor matrix, int k_cols, bst_float* matrix_data_d)
: matrix(std::move(matrix)), k_cols(k_cols), matrix_data_d(matrix_data_d) {}

__device__ void operator()(size_t global_idx) {
auto row = global_idx / kCols;
auto col = global_idx % kCols;
auto row = global_idx / k_cols;
auto col = global_idx % k_cols;
auto value = matrix.GetBinIndex(row, col);
if (isnan(value)) {
if (isnan(float(value))) {
value = -1;
}
matrix_data_d[global_idx] = value;
Expand Down Expand Up @@ -403,7 +403,7 @@ void DeviceHistogramBuilder::BuildHistogram(Context const* ctx,
auto plugin = fed.EncryptionPlugin();

// Transmit matrix to plugin
if (!is_aggr_context_initialized_) {
if (!is_aggr_context_initialized) {
// Get cutptrs
std::vector<uint32_t> h_cuts_ptr(matrix.feature_segments.size());
dh::CopyDeviceSpanToVector(&h_cuts_ptr, matrix.feature_segments);
Expand All @@ -423,7 +423,7 @@ void DeviceHistogramBuilder::BuildHistogram(Context const* ctx,

// Initialize plugin context
plugin->Reset(h_cuts_ptr, h_bin_idx);
is_aggr_context_initialized_ = true;
is_aggr_context_initialized = true;
}

// get row indices from device
Expand Down
2 changes: 1 addition & 1 deletion src/tree/gpu_hist/histogram.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class DeviceHistogramBuilder {
DeviceHistogramBuilder();
~DeviceHistogramBuilder();
// Whether to secure aggregation context has been initialized
bool is_aggr_context_initialized_{false};
bool is_aggr_context_initialized{false};
void Reset(Context const* ctx, FeatureGroupsAccessor const& feature_groups,
bool force_global_memory);
void BuildHistogram(Context const* ctx, EllpackDeviceAccessor const& matrix,
Expand Down

0 comments on commit ba82521

Please sign in to comment.