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
|
python -m pip install wheel setuptools cpplint pylint
|
||||||
- name: Run lint
|
- name: Run lint
|
||||||
run: |
|
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:
|
sphinx:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@ -8,15 +8,16 @@
|
|||||||
#define XGBOOST_METRIC_H_
|
#define XGBOOST_METRIC_H_
|
||||||
|
|
||||||
#include <dmlc/registry.h>
|
#include <dmlc/registry.h>
|
||||||
#include <xgboost/model.h>
|
|
||||||
#include <xgboost/data.h>
|
|
||||||
#include <xgboost/base.h>
|
#include <xgboost/base.h>
|
||||||
|
#include <xgboost/data.h>
|
||||||
#include <xgboost/host_device_vector.h>
|
#include <xgboost/host_device_vector.h>
|
||||||
|
#include <xgboost/model.h>
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <memory> // shared_ptr
|
||||||
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
struct Context;
|
struct Context;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ const MetaInfo &SparsePageDMatrix::Info() const { return info_; }
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
// Use device dispatch
|
// Use device dispatch
|
||||||
std::size_t NSamplesDevice(DMatrixProxy *)
|
std::size_t NSamplesDevice(DMatrixProxy *) // NOLINT
|
||||||
#if defined(XGBOOST_USE_CUDA)
|
#if defined(XGBOOST_USE_CUDA)
|
||||||
; // NOLINT
|
; // NOLINT
|
||||||
#else
|
#else
|
||||||
@ -28,7 +28,7 @@ std::size_t NSamplesDevice(DMatrixProxy *)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
std::size_t NFeaturesDevice(DMatrixProxy *)
|
std::size_t NFeaturesDevice(DMatrixProxy *) // NOLINT
|
||||||
#if defined(XGBOOST_USE_CUDA)
|
#if defined(XGBOOST_USE_CUDA)
|
||||||
; // NOLINT
|
; // NOLINT
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cub/cub.cuh>
|
#include <cub/cub.cuh> // NOLINT
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
#define XGBOOST_METRIC_METRIC_COMMON_H_
|
#define XGBOOST_METRIC_METRIC_COMMON_H_
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <memory> // shared_ptr
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "../common/common.h"
|
#include "../common/common.h"
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#include <thrust/sort.h>
|
#include <thrust/sort.h>
|
||||||
|
|
||||||
#include <cstdint> // std::int32_t
|
#include <cstdint> // std::int32_t
|
||||||
#include <cub/cub.cuh>
|
#include <cub/cub.cuh> // NOLINT
|
||||||
|
|
||||||
#include "../common/cuda_context.cuh" // CUDAContext
|
#include "../common/cuda_context.cuh" // CUDAContext
|
||||||
#include "../common/device_helpers.cuh"
|
#include "../common/device_helpers.cuh"
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "cpu_treeshap.h"
|
#include "cpu_treeshap.h"
|
||||||
|
|
||||||
|
#include <algorithm> // copy
|
||||||
#include <cinttypes> // std::uint32_t
|
#include <cinttypes> // std::uint32_t
|
||||||
|
|
||||||
#include "predict_fn.h" // GetNextNode
|
#include "predict_fn.h" // GetNextNode
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
|
#ifndef XGBOOST_PREDICTOR_CPU_TREESHAP_H_
|
||||||
|
#define XGBOOST_PREDICTOR_CPU_TREESHAP_H_
|
||||||
/**
|
/**
|
||||||
* Copyright by XGBoost Contributors 2017-2022
|
* Copyright by XGBoost Contributors 2017-2022
|
||||||
*/
|
*/
|
||||||
|
#include <vector> // vector
|
||||||
|
|
||||||
#include "xgboost/tree_model.h" // RegTree
|
#include "xgboost/tree_model.h" // RegTree
|
||||||
|
|
||||||
namespace xgboost {
|
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,
|
std::vector<float> *mean_values, bst_float *out_contribs, int condition,
|
||||||
unsigned condition_feature);
|
unsigned condition_feature);
|
||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
#endif // XGBOOST_PREDICTOR_CPU_TREESHAP_H_
|
||||||
|
|||||||
@ -359,7 +359,7 @@ void GPUHistEvaluator::LaunchEvaluateSplits(
|
|||||||
|
|
||||||
// One block for each feature
|
// One block for each feature
|
||||||
uint32_t constexpr kBlockThreads = 32;
|
uint32_t constexpr kBlockThreads = 32;
|
||||||
dh::LaunchKernel{static_cast<uint32_t>(combined_num_features), kBlockThreads,
|
dh::LaunchKernel {static_cast<uint32_t>(combined_num_features), kBlockThreads,
|
||||||
0}(
|
0}(
|
||||||
EvaluateSplitsKernel<kBlockThreads>, max_active_features, d_inputs,
|
EvaluateSplitsKernel<kBlockThreads>, max_active_features, d_inputs,
|
||||||
shared_inputs,
|
shared_inputs,
|
||||||
|
|||||||
@ -299,7 +299,7 @@ void BuildGradientHistogram(CUDAContext const* ctx, EllpackDeviceAccessor const&
|
|||||||
min(grid_size,
|
min(grid_size,
|
||||||
unsigned(common::DivRoundUp(items_per_group, kMinItemsPerBlock)));
|
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(),
|
ctx->Stream()} (kernel, matrix, feature_groups, d_ridx, histogram.data(),
|
||||||
gpair.data(), rounding);
|
gpair.data(), rounding);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user