From ba825213f56f78226c47003e25741b30f0b84db2 Mon Sep 17 00:00:00 2001 From: Ziyue Xu Date: Fri, 9 Aug 2024 10:53:25 -0400 Subject: [PATCH] updates for PR checks --- src/tree/gpu_hist/histogram.cu | 16 ++++++++-------- src/tree/gpu_hist/histogram.cuh | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tree/gpu_hist/histogram.cu b/src/tree/gpu_hist/histogram.cu index 3f608f1c4f64..2b52f03a1dbf 100644 --- a/src/tree/gpu_hist/histogram.cu +++ b/src/tree/gpu_hist/histogram.cu @@ -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; @@ -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 h_cuts_ptr(matrix.feature_segments.size()); dh::CopyDeviceSpanToVector(&h_cuts_ptr, matrix.feature_segments); @@ -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 diff --git a/src/tree/gpu_hist/histogram.cuh b/src/tree/gpu_hist/histogram.cuh index 08ba9be856fc..aedcacbb92d8 100644 --- a/src/tree/gpu_hist/histogram.cuh +++ b/src/tree/gpu_hist/histogram.cuh @@ -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,