Skip to content

Commit d74009e

Browse files
authored
Add #pragma once to prevent redundant includes and speed up compilation (#18925)
Discovered while working on #18896, this PR adds `#pragma once` directives to eliminate redundant header inclusions and reduce compilation time. Authors: - Yunsong Wang (https://github.com/PointKernel) - Bradley Dice (https://github.com/bdice) Approvers: - David Wendt (https://github.com/davidwendt) - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) URL: #18925
1 parent a664c14 commit d74009e

File tree

21 files changed

+56
-13
lines changed

21 files changed

+56
-13
lines changed

cpp/benchmarks/ndsh/utilities.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include "io/cuio_common.hpp"
1820

1921
#include <cudf/detail/nvtx/ranges.hpp>

cpp/benchmarks/stream_compaction/stream_compaction_common.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2020-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <cudf/stream_compaction.hpp>
1820

1921
cudf::duplicate_keep_option get_keep(std::string const& keep_str);

cpp/examples/utilities/timer.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <chrono>
1820
#include <iostream>
1921

cpp/include/cudf/detail/labeling/label_segments.cuh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <cudf/types.hpp>
1820

1921
#include <rmm/cuda_stream_view.hpp>

cpp/include/cudf/detail/utilities/batched_memcpy.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <cudf/detail/iterator.cuh>
1820
#include <cudf/utilities/memory_resource.hpp>
1921

cpp/include/cudf/detail/utilities/batched_memset.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <cudf/detail/iterator.cuh>
1820
#include <cudf/detail/utilities/vector_factories.hpp>
1921
#include <cudf/utilities/memory_resource.hpp>

cpp/include/cudf/detail/utilities/host_worker_pool.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <BS_thread_pool.hpp>
1820

1921
namespace cudf::detail {

cpp/include/cudf/strings/detail/convert/string_to_float.cuh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <cudf/strings/detail/convert/is_float.cuh>
1820
#include <cudf/strings/string_view.cuh>
1921

cpp/src/hash/sha_hash.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -13,6 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
#pragma once
18+
1619
#include <cudf/column/column_device_view.cuh>
1720
#include <cudf/column/column_factories.hpp>
1821
#include <cudf/detail/iterator.cuh>

cpp/src/io/utilities/output_builder.cuh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
#pragma once
18+
1719
#include <cudf/types.hpp>
1820
#include <cudf/utilities/error.hpp>
1921
#include <cudf/utilities/memory_resource.hpp>

0 commit comments

Comments
 (0)