Skip to content
Open
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- id: cpplint
args:
- --recursive
- --filter=-build/include_subdir,-build/header_guard,-whitespace/indent_namespace,-whitespace/line_length
- --filter=-build/include_subdir,-whitespace/indent_namespace,-whitespace/line_length
- repo: local
hooks:
- id: check-omp-pragmas
Expand Down
6 changes: 3 additions & 3 deletions R-package/src/lightgbm_R.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 R_PACKAGE_SRC_LIGHTGBM_R_H_
#define R_PACKAGE_SRC_LIGHTGBM_R_H_

#include <LightGBM/c_api.h>

Expand Down Expand Up @@ -903,4 +903,4 @@ LIGHTGBM_C_EXPORT SEXP LGBM_SetMaxThreads_R(
SEXP num_threads
);

#endif // LIGHTGBM_R_H_
#endif // R_PACKAGE_SRC_LIGHTGBM_R_H_
6 changes: 3 additions & 3 deletions include/LightGBM/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_APPLICATION_H_
#define INCLUDE_LIGHTGBM_APPLICATION_H_

#include <LightGBM/config.h>
#include <LightGBM/meta.h>
Expand Down Expand Up @@ -89,4 +89,4 @@ inline void Application::Run() {

} // namespace LightGBM

#endif // LightGBM_APPLICATION_H_
#endif // INCLUDE_LIGHTGBM_APPLICATION_H_
6 changes: 3 additions & 3 deletions include/LightGBM/arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Author: Oliver Borchert
*/

#ifndef LIGHTGBM_ARROW_H_
#define LIGHTGBM_ARROW_H_
#ifndef INCLUDE_LIGHTGBM_ARROW_H_
#define INCLUDE_LIGHTGBM_ARROW_H_

#include <algorithm>
#include <cstdint>
Expand Down Expand Up @@ -296,4 +296,4 @@ class ArrowTable {

#include "arrow.tpp"

#endif /* LIGHTGBM_ARROW_H_ */
#endif // INCLUDE_LIGHTGBM_ARROW_H_
6 changes: 3 additions & 3 deletions include/LightGBM/bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_BIN_H_
#define INCLUDE_LIGHTGBM_BIN_H_

#include <LightGBM/meta.h>
#include <LightGBM/utils/common.h>
Expand Down Expand Up @@ -651,4 +651,4 @@ inline uint32_t BinMapper::ValueToBin(double value) const {

} // namespace LightGBM

#endif // LightGBM_BIN_H_
#endif // INCLUDE_LIGHTGBM_BIN_H_
6 changes: 3 additions & 3 deletions include/LightGBM/boosting.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_BOOSTING_H_
#define INCLUDE_LIGHTGBM_BOOSTING_H_

#include <LightGBM/config.h>
#include <LightGBM/meta.h>
Expand Down Expand Up @@ -328,4 +328,4 @@ class GBDTBase : public Boosting {

} // namespace LightGBM

#endif // LightGBM_BOOSTING_H_
#endif // INCLUDE_LIGHTGBM_BOOSTING_H_
6 changes: 3 additions & 3 deletions include/LightGBM/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_C_API_H_
#define INCLUDE_LIGHTGBM_C_API_H_

#include <LightGBM/arrow.h>
#include <LightGBM/export.h>
Expand Down Expand Up @@ -1663,4 +1663,4 @@ INLINE_FUNCTION void LGBM_SetLastError(const char* msg) {
#endif
}

#endif /* LIGHTGBM_C_API_H_ */
#endif /* INCLUDE_LIGHTGBM_C_API_H_ */
6 changes: 3 additions & 3 deletions include/LightGBM/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_CONFIG_H_
#define INCLUDE_LIGHTGBM_CONFIG_H_

#include <LightGBM/export.h>
#include <LightGBM/meta.h>
Expand Down Expand Up @@ -1319,4 +1319,4 @@ inline std::string ParseMetricAlias(const std::string& type) {

} // namespace LightGBM

#endif // LightGBM_CONFIG_H_
#endif // INCLUDE_LIGHTGBM_CONFIG_H_
6 changes: 3 additions & 3 deletions include/LightGBM/cuda/cuda_algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#define INCLUDE_LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_

#ifdef USE_CUDA

Expand Down Expand Up @@ -620,4 +620,4 @@ __device__ VAL_T PercentileDevice(const VAL_T* values,
} // namespace LightGBM

#endif // USE_CUDA
#endif // LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_ALGORITHMS_HPP_
10 changes: 5 additions & 5 deletions include/LightGBM/cuda/cuda_column_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/

#ifdef USE_CUDA
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
#define 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>
Expand Down Expand Up @@ -137,6 +137,6 @@ class CUDAColumnData {

} // namespace LightGBM

#endif // LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_

#endif // USE_CUDA

#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_COLUMN_DATA_HPP_
10 changes: 5 additions & 5 deletions include/LightGBM/cuda/cuda_metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/

#ifdef USE_CUDA
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_METADATA_HPP_
#define 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>
Expand Down Expand Up @@ -53,6 +53,6 @@ class CUDAMetadata {

} // namespace LightGBM

#endif // LIGHTGBM_CUDA_CUDA_METADATA_HPP_

#endif // USE_CUDA

#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_METADATA_HPP_
6 changes: 3 additions & 3 deletions include/LightGBM/cuda/cuda_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* license information.
*/

#ifndef LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#define LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#define INCLUDE_LIGHTGBM_CUDA_CUDA_METRIC_HPP_

#ifdef USE_CUDA

Expand Down Expand Up @@ -41,4 +41,4 @@ class CUDAMetricInterface: public HOST_METRIC {

#endif // USE_CUDA

#endif // LIGHTGBM_CUDA_CUDA_METRIC_HPP_
#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_METRIC_HPP_
6 changes: 3 additions & 3 deletions include/LightGBM/cuda/cuda_objective_function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* license information.
*/

#ifndef LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#define LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#define INCLUDE_LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_

#ifdef USE_CUDA

Expand Down Expand Up @@ -83,4 +83,4 @@ class CUDAObjectiveInterface: public HOST_OBJECTIVE {

#endif // USE_CUDA

#endif // LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_OBJECTIVE_FUNCTION_HPP_
6 changes: 3 additions & 3 deletions include/LightGBM/cuda/cuda_random.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#define INCLUDE_LIGHTGBM_CUDA_CUDA_RANDOM_HPP_

#ifdef USE_CUDA

Expand Down Expand Up @@ -71,4 +71,4 @@ class CUDARandom {

#endif // USE_CUDA

#endif // LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_RANDOM_HPP_
10 changes: 8 additions & 2 deletions include/LightGBM/cuda/cuda_rocm_interop.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/*!
* Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/

#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
#define INCLUDE_LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_

#ifdef USE_CUDA

#if defined(__HIP_PLATFORM_AMD__) || defined(__HIP__)
Expand All @@ -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 // INCLUDE_LIGHTGBM_CUDA_CUDA_ROCM_INTEROP_H_
9 changes: 5 additions & 4 deletions include/LightGBM/cuda/cuda_row_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/

#ifdef USE_CUDA
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
#define 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>
Expand Down Expand Up @@ -175,6 +175,7 @@ class CUDARowData {
};

} // namespace LightGBM
#endif // LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_

#endif // USE_CUDA

#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_ROW_DATA_HPP_
10 changes: 5 additions & 5 deletions include/LightGBM/cuda/cuda_split_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Modifications Copyright(C) 2023 Advanced Micro Devices, Inc. All rights reserved.
*/

#ifdef USE_CUDA
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
#define 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>

Expand Down Expand Up @@ -103,6 +103,6 @@ class CUDASplitInfo {

} // namespace LightGBM

#endif // LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_

#endif // USE_CUDA

#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_SPLIT_INFO_HPP_
10 changes: 5 additions & 5 deletions include/LightGBM/cuda/cuda_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*/

#ifdef USE_CUDA
#ifndef INCLUDE_LIGHTGBM_CUDA_CUDA_TREE_HPP_
#define 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>
Expand Down Expand Up @@ -168,6 +168,6 @@ class CUDATree : public Tree {

} // namespace LightGBM

#endif // LIGHTGBM_CUDA_CUDA_TREE_HPP_

#endif // USE_CUDA

#endif // INCLUDE_LIGHTGBM_CUDA_CUDA_TREE_HPP_
6 changes: 3 additions & 3 deletions include/LightGBM/cuda/vector_cudahost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#define INCLUDE_LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_

#include <LightGBM/utils/common.h>

Expand Down Expand Up @@ -91,4 +91,4 @@ bool operator!=(const CHAllocator<T>&, const CHAllocator<U>&);

} // namespace LightGBM

#endif // LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
#endif // INCLUDE_LIGHTGBM_CUDA_VECTOR_CUDAHOST_H_
6 changes: 3 additions & 3 deletions include/LightGBM/dataset.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 INCLUDE_LIGHTGBM_DATASET_H_
#define INCLUDE_LIGHTGBM_DATASET_H_

#include <LightGBM/arrow.h>
#include <LightGBM/config.h>
Expand Down Expand Up @@ -1071,4 +1071,4 @@ class Dataset {

} // namespace LightGBM

#endif // LightGBM_DATA_H_
#endif // INCLUDE_LIGHTGBM_DATASET_H_
6 changes: 3 additions & 3 deletions include/LightGBM/dataset_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_LOADER_H_
#define LIGHTGBM_DATASET_LOADER_H_
#ifndef INCLUDE_LIGHTGBM_DATASET_LOADER_H_
#define INCLUDE_LIGHTGBM_DATASET_LOADER_H_

#include <LightGBM/dataset.h>

Expand Down Expand Up @@ -107,4 +107,4 @@ class DatasetLoader {

} // namespace LightGBM

#endif // LIGHTGBM_DATASET_LOADER_H_
#endif // INCLUDE_LIGHTGBM_DATASET_LOADER_H_
Loading
Loading