Fix CPP lint. (#8807)
This commit is contained in:
parent
e62167937b
commit
594371e35b
13
.github/workflows/main.yml
vendored
13
.github/workflows/main.yml
vendored
@ -144,7 +144,18 @@ jobs:
|
||||
python -m pip install wheel setuptools cpplint pylint
|
||||
- name: Run lint
|
||||
run: |
|
||||
python dmlc-core/scripts/lint.py xgboost cpp R-package/src
|
||||
python3 dmlc-core/scripts/lint.py xgboost cpp R-package/src
|
||||
|
||||
python3 dmlc-core/scripts/lint.py --exclude_path \
|
||||
python-package/xgboost/dmlc-core \
|
||||
python-package/xgboost/include \
|
||||
python-package/xgboost/lib \
|
||||
python-package/xgboost/rabit \
|
||||
python-package/xgboost/src \
|
||||
--pylint-rc python-package/.pylintrc \
|
||||
xgboost \
|
||||
cpp \
|
||||
include src python-package
|
||||
|
||||
sphinx:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -8,15 +8,16 @@
|
||||
#define XGBOOST_METRIC_H_
|
||||
|
||||
#include <dmlc/registry.h>
|
||||
#include <xgboost/model.h>
|
||||
#include <xgboost/data.h>
|
||||
#include <xgboost/base.h>
|
||||
#include <xgboost/data.h>
|
||||
#include <xgboost/host_device_vector.h>
|
||||
#include <xgboost/model.h>
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
#include <memory> // shared_ptr
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace xgboost {
|
||||
struct Context;
|
||||
|
||||
@ -19,7 +19,7 @@ const MetaInfo &SparsePageDMatrix::Info() const { return info_; }
|
||||
|
||||
namespace detail {
|
||||
// Use device dispatch
|
||||
std::size_t NSamplesDevice(DMatrixProxy *)
|
||||
std::size_t NSamplesDevice(DMatrixProxy *) // NOLINT
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
; // NOLINT
|
||||
#else
|
||||
@ -28,7 +28,7 @@ std::size_t NSamplesDevice(DMatrixProxy *)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
std::size_t NFeaturesDevice(DMatrixProxy *)
|
||||
std::size_t NFeaturesDevice(DMatrixProxy *) // NOLINT
|
||||
#if defined(XGBOOST_USE_CUDA)
|
||||
; // NOLINT
|
||||
#else
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cub/cub.cuh>
|
||||
#include <cub/cub.cuh> // NOLINT
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#define XGBOOST_METRIC_METRIC_COMMON_H_
|
||||
|
||||
#include <limits>
|
||||
#include <memory> // shared_ptr
|
||||
#include <string>
|
||||
|
||||
#include "../common/common.h"
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
*/
|
||||
#include <thrust/sort.h>
|
||||
|
||||
#include <cstdint> // std::int32_t
|
||||
#include <cub/cub.cuh>
|
||||
#include <cstdint> // std::int32_t
|
||||
#include <cub/cub.cuh> // NOLINT
|
||||
|
||||
#include "../common/cuda_context.cuh" // CUDAContext
|
||||
#include "../common/device_helpers.cuh"
|
||||
|
||||
@ -3,10 +3,11 @@
|
||||
*/
|
||||
#include "cpu_treeshap.h"
|
||||
|
||||
#include <cinttypes> // std::uint32_t
|
||||
#include <algorithm> // copy
|
||||
#include <cinttypes> // std::uint32_t
|
||||
|
||||
#include "predict_fn.h" // GetNextNode
|
||||
#include "xgboost/base.h" // bst_node_t
|
||||
#include "predict_fn.h" // GetNextNode
|
||||
#include "xgboost/base.h" // bst_node_t
|
||||
#include "xgboost/logging.h"
|
||||
#include "xgboost/tree_model.h" // RegTree
|
||||
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
#ifndef XGBOOST_PREDICTOR_CPU_TREESHAP_H_
|
||||
#define XGBOOST_PREDICTOR_CPU_TREESHAP_H_
|
||||
/**
|
||||
* Copyright by XGBoost Contributors 2017-2022
|
||||
*/
|
||||
#include <vector> // vector
|
||||
|
||||
#include "xgboost/tree_model.h" // RegTree
|
||||
|
||||
namespace xgboost {
|
||||
@ -15,3 +19,4 @@ void CalculateContributions(RegTree const &tree, const RegTree::FVec &feat,
|
||||
std::vector<float> *mean_values, bst_float *out_contribs, int condition,
|
||||
unsigned condition_feature);
|
||||
} // namespace xgboost
|
||||
#endif // XGBOOST_PREDICTOR_CPU_TREESHAP_H_
|
||||
|
||||
@ -359,8 +359,8 @@ void GPUHistEvaluator::LaunchEvaluateSplits(
|
||||
|
||||
// One block for each feature
|
||||
uint32_t constexpr kBlockThreads = 32;
|
||||
dh::LaunchKernel{static_cast<uint32_t>(combined_num_features), kBlockThreads,
|
||||
0}(
|
||||
dh::LaunchKernel {static_cast<uint32_t>(combined_num_features), kBlockThreads,
|
||||
0}(
|
||||
EvaluateSplitsKernel<kBlockThreads>, max_active_features, d_inputs,
|
||||
shared_inputs,
|
||||
this->SortedIdx(d_inputs.size(), shared_inputs.feature_values.size()),
|
||||
|
||||
@ -299,7 +299,7 @@ void BuildGradientHistogram(CUDAContext const* ctx, EllpackDeviceAccessor const&
|
||||
min(grid_size,
|
||||
unsigned(common::DivRoundUp(items_per_group, kMinItemsPerBlock)));
|
||||
|
||||
dh::LaunchKernel{dim3(grid_size, num_groups), static_cast<uint32_t>(kBlockThreads), smem_size,
|
||||
dh::LaunchKernel {dim3(grid_size, num_groups), static_cast<uint32_t>(kBlockThreads), smem_size,
|
||||
ctx->Stream()} (kernel, matrix, feature_groups, d_ridx, histogram.data(),
|
||||
gpair.data(), rounding);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user