Unverified Commit c5c60c8f authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[ci][c++] fixed `build/header_guard` errors from cpplint (#7055)

parent 32781bae
......@@ -27,8 +27,9 @@ repos:
hooks:
- id: cpplint
args:
- --root=.. # workaround to get correct header guard pattern
- --recursive
- --filter=-build/include_subdir,-build/header_guard,-whitespace/line_length
- --filter=-build/include_subdir,-whitespace/line_length
- repo: local
hooks:
- id: check-omp-pragmas
......
......@@ -2,8 +2,8 @@
* Copyright (c) 2017 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_R_H_
#define LIGHTGBM_R_H_
#ifndef LIGHTGBM_R_PACKAGE_SRC_LIGHTGBM_R_H_
#define LIGHTGBM_R_PACKAGE_SRC_LIGHTGBM_R_H_
#include <LightGBM/c_api.h>
......@@ -903,4 +903,4 @@ LIGHTGBM_C_EXPORT SEXP LGBM_SetMaxThreads_R(
SEXP num_threads
);
#endif // LIGHTGBM_R_H_
#endif // LIGHTGBM_R_PACKAGE_SRC_LIGHTGBM_R_H_
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_APPLICATION_H_
#define LIGHTGBM_APPLICATION_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_APPLICATION_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_APPLICATION_H_
#include <LightGBM/config.h>
#include <LightGBM/meta.h>
......@@ -89,4 +89,4 @@ inline void Application::Run() {
} // namespace LightGBM
#endif // LightGBM_APPLICATION_H_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_APPLICATION_H_
......@@ -5,8 +5,8 @@
* Author: Oliver Borchert
*/
#ifndef LIGHTGBM_ARROW_H_
#define LIGHTGBM_ARROW_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_ARROW_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_ARROW_H_
#include <algorithm>
#include <cstdint>
......@@ -296,4 +296,4 @@ class ArrowTable {
#include "arrow.tpp"
#endif /* LIGHTGBM_ARROW_H_ */
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_ARROW_H_
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_BIN_H_
#define LIGHTGBM_BIN_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_BIN_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_BIN_H_
#include <LightGBM/meta.h>
#include <LightGBM/utils/common.h>
......@@ -651,4 +651,4 @@ inline uint32_t BinMapper::ValueToBin(double value) const {
} // namespace LightGBM
#endif // LightGBM_BIN_H_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_BIN_H_
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_BOOSTING_H_
#define LIGHTGBM_BOOSTING_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_BOOSTING_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_BOOSTING_H_
#include <LightGBM/config.h>
#include <LightGBM/meta.h>
......@@ -328,4 +328,4 @@ class GBDTBase : public Boosting {
} // namespace LightGBM
#endif // LightGBM_BOOSTING_H_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_BOOSTING_H_
......@@ -10,8 +10,8 @@
* .
* The reason is that they are called frequently, and the type conversion on them may be time-cost.
*/
#ifndef LIGHTGBM_C_API_H_
#define LIGHTGBM_C_API_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_C_API_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_C_API_H_
#include <LightGBM/arrow.h>
#include <LightGBM/export.h>
......@@ -1663,4 +1663,4 @@ INLINE_FUNCTION void LGBM_SetLastError(const char* msg) {
#endif
}
#endif /* LIGHTGBM_C_API_H_ */
#endif /* LIGHTGBM_INCLUDE_LIGHTGBM_C_API_H_ */
......@@ -13,8 +13,8 @@
* - param is only used by the CLI (especially the "predict" and "convert_model" tasks)
* - param is related to LightGBM writing files (e.g. "output_model", "save_binary")
*/
#ifndef LIGHTGBM_CONFIG_H_
#define LIGHTGBM_CONFIG_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CONFIG_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CONFIG_H_
#include <LightGBM/export.h>
#include <LightGBM/meta.h>
......@@ -1320,4 +1320,4 @@ inline std::string ParseMetricAlias(const std::string& type) {
} // namespace LightGBM
#endif // LightGBM_CONFIG_H_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CONFIG_H_
......@@ -4,8 +4,8 @@
* Modifications Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/
#ifndef LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#define LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#ifdef USE_CUDA
......@@ -620,4 +620,4 @@ __device__ VAL_T PercentileDevice(const VAL_T* values,
} // namespace LightGBM
#endif // USE_CUDA
#endif // LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
......@@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifdef USE_CUDA
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
#ifndef LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
#define LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
#ifdef USE_CUDA
#include <LightGBM/config.h>
#include <LightGBM/cuda/cuda_utils.hu>
......@@ -137,6 +137,6 @@ class CUDAColumnData {
} // namespace LightGBM
#endif // LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
#endif // USE_CUDA
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
......@@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifdef USE_CUDA
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_METADATA_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_METADATA_HPP_
#ifndef LIGHTGBM_CUDA_CUDA_METADATA_HPP_
#define LIGHTGBM_CUDA_CUDA_METADATA_HPP_
#ifdef USE_CUDA
#include <LightGBM/cuda/cuda_utils.hu>
#include <LightGBM/meta.h>
......@@ -53,6 +53,6 @@ class CUDAMetadata {
} // namespace LightGBM
#endif // LIGHTGBM_CUDA_CUDA_METADATA_HPP_
#endif // USE_CUDA
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_METADATA_HPP_
......@@ -4,8 +4,8 @@
* license information.
*/
#ifndef LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#define LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#ifdef USE_CUDA
......@@ -41,4 +41,4 @@ class CUDAMetricInterface: public HOST_METRIC {
#endif // USE_CUDA
#endif // LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_METRIC_HPP_
......@@ -4,8 +4,8 @@
* license information.
*/
#ifndef LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#define LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#ifdef USE_CUDA
......@@ -83,4 +83,4 @@ class CUDAObjectiveInterface: public HOST_OBJECTIVE {
#endif // USE_CUDA
#endif // LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
......@@ -2,8 +2,8 @@
* Copyright (c) 2021 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#define LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#ifdef USE_CUDA
......@@ -71,4 +71,4 @@ class CUDARandom {
#endif // USE_CUDA
#endif // LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
/*!
* Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
#ifdef USE_CUDA
#if defined(__HIP_PLATFORM_AMD__) || defined(__HIP__)
......@@ -15,6 +19,8 @@
#else
// CUDA warpSize is not a constexpr, but always 32
#define WARPSIZE 32
#endif
#endif // defined(__HIP_PLATFORM_AMD__) || defined(__HIP__)
#endif // USE_CUDA
#endif
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
......@@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifdef USE_CUDA
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
#ifndef LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
#define LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
#ifdef USE_CUDA
#include <LightGBM/bin.h>
#include <LightGBM/config.h>
......@@ -175,6 +175,7 @@ class CUDARowData {
};
} // namespace LightGBM
#endif // LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
#endif // USE_CUDA
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
......@@ -5,10 +5,10 @@
* Modifications Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/
#ifdef USE_CUDA
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
#ifndef LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
#define LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
#ifdef USE_CUDA
#include <LightGBM/meta.h>
......@@ -103,6 +103,6 @@ class CUDASplitInfo {
} // namespace LightGBM
#endif // LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
#endif // USE_CUDA
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
......@@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifdef USE_CUDA
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_TREE_HPP_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_TREE_HPP_
#ifndef LIGHTGBM_CUDA_CUDA_TREE_HPP_
#define LIGHTGBM_CUDA_CUDA_TREE_HPP_
#ifdef USE_CUDA
#include <LightGBM/cuda/cuda_column_data.hpp>
#include <LightGBM/cuda/cuda_split_info.hpp>
......@@ -168,6 +168,6 @@ class CUDATree : public Tree {
} // namespace LightGBM
#endif // LIGHTGBM_CUDA_CUDA_TREE_HPP_
#endif // USE_CUDA
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_CUDA_TREE_HPP_
......@@ -3,8 +3,8 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
* Modifications Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/
#ifndef LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#define LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#include <LightGBM/utils/common.h>
......@@ -91,4 +91,4 @@ bool operator!=(const CHAllocator<T>&, const CHAllocator<U>&);
} // namespace LightGBM
#endif // LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
......@@ -2,8 +2,8 @@
* Copyright (c) 2016 Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/
#ifndef LIGHTGBM_DATASET_H_
#define LIGHTGBM_DATASET_H_
#ifndef LIGHTGBM_INCLUDE_LIGHTGBM_DATASET_H_
#define LIGHTGBM_INCLUDE_LIGHTGBM_DATASET_H_
#include <LightGBM/arrow.h>
#include <LightGBM/config.h>
......@@ -1071,4 +1071,4 @@ class Dataset {
} // namespace LightGBM
#endif // LightGBM_DATA_H_
#endif // LIGHTGBM_INCLUDE_LIGHTGBM_DATASET_H_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment