Skip to content

Commit

Permalink
[code style] Change pragma once to appropriate header guards in bench…
Browse files Browse the repository at this point in the history
…marks (#1029)
  • Loading branch information
kiselik authored Jan 10, 2025
1 parent b226455 commit fab4571
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 36 deletions.
5 changes: 3 additions & 2 deletions tools/benchmarks/include/cmd_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_CMD_DECL_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_CMD_DECL_HPP

#include <algorithm>
#include <commandlineflags.h>
Expand All @@ -25,3 +25,4 @@ std::int32_t get_block_size();
mem_loc_e get_in_mem();
mem_loc_e get_out_mem();
} // namespace bench::cmd
#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_CMD_DECL_HPP
5 changes: 3 additions & 2 deletions tools/benchmarks/include/data_providers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_DATA_PROVIDERS_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_DATA_PROVIDERS_HPP

#include <algorithm>
#include <cstdint>
Expand Down Expand Up @@ -83,3 +83,4 @@ static inline auto split_data(const data_t& data, std::size_t block_size) {
return blocks;
}
} // namespace bench::data
#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_DATA_PROVIDERS_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/details/measure_async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_MEASURE_ASYNC_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_MEASURE_ASYNC_HPP

#include <benchmark/benchmark.h>

Expand Down Expand Up @@ -112,3 +112,5 @@ static statistics_t measure_async(benchmark::State& state, const case_params_t&
return res;
}
} // namespace bench::details

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_MEASURE_ASYNC_HPP
5 changes: 3 additions & 2 deletions tools/benchmarks/include/details/measure_sync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_MEASURE_SYNC_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_MEASURE_SYNC_HPP

#include <benchmark/benchmark.h>
#include <ops/ops.hpp>
Expand Down Expand Up @@ -62,3 +62,4 @@ static statistics_t measure_sync(benchmark::State& state, const case_params_t& c
return res;
}
} // namespace bench::details
#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_MEASURE_SYNC_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/details/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_UTILITY_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_UTILITY_HPP

#include "cmd_decl.hpp"

Expand Down Expand Up @@ -84,3 +84,5 @@ inline void mem_control(RangeT begin, RangeT end, mem_loc_e op) noexcept {
__builtin_ia32_mfence();
}
} // namespace bench::details

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_DETAILS_UTILITY_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/huffman_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_HUFFMAN_TABLE_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_HUFFMAN_TABLE_HPP

#include <cstdint>
#include <string>
Expand Down Expand Up @@ -83,3 +83,5 @@ static qpl_huffman_table_t deflate_huffman_table_maker(const qpl_huffman_table_t
*/
static auto any_huffman_table_deleter = [](qpl_huffman_table_t t) { qpl_huffman_table_destroy(t); };
} // namespace bench

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_HUFFMAN_TABLE_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/measure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_MEASURE_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_MEASURE_HPP

#include <benchmark/benchmark.h>
#include <details/measure_async.hpp>
Expand All @@ -21,3 +21,5 @@ static inline statistics_t measure(benchmark::State& state, const case_params_t&
return details::measure_sync<path>(state, common_params, operations, params);
}
} // namespace bench

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_MEASURE_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_BASE_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_BASE_HPP

#include <cstdint>
#include <ops/results.hpp>
Expand Down Expand Up @@ -116,3 +116,5 @@ class operation_base_t {
std::size_t bytes_written_ {0};
};
} // namespace bench::ops

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_BASE_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/c_api/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_BASE_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_BASE_HPP

#include <memory.h>
#include <ops/base.hpp>
Expand Down Expand Up @@ -89,3 +89,5 @@ class operation_base_t : public ops::operation_base_t<DerivedT> {
qpl_job* job_ {nullptr};
};
} // namespace bench::ops::c_api

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_BASE_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/c_api/crc64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_CRC64_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_CRC64_HPP

#include <ops/c_api/base.hpp>
#include <stdexcept>
Expand Down Expand Up @@ -174,3 +174,5 @@ struct traits<operation_base_t<c_api::crc64_t<path>>> {
using result_t = crc64_results_t;
};
} // namespace bench::ops

#endif //QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_CRC64_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/c_api/deflate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_DEFLATE_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_DEFLATE_HPP

#include <ops/c_api/base.hpp>
#include <stdexcept>
Expand Down Expand Up @@ -148,3 +148,5 @@ struct traits<operation_base_t<c_api::deflate_t<path>>> {
using result_t = deflate_results_t;
};
} // namespace bench::ops

#endif //QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_DEFLATE_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/c_api/inflate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_INFLATE_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_INFLATE_HPP

#include <ops/c_api/base.hpp>
#include <stdexcept>
Expand Down Expand Up @@ -138,3 +138,5 @@ struct traits<operation_base_t<c_api::inflate_t<path>>> {
using result_t = inflate_results_t;
};
} // namespace bench::ops

#endif //QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_C_API_INFLATE_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_DISPATCHER_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_DISPATCHER_HPP

#include <types.hpp>

Expand All @@ -29,3 +29,5 @@ struct api_dispatcher_t<api_e::c, path, operation_e::crc64> {
using impl_t = c_api::crc64_t<path>;
};
} // namespace bench::ops

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_DISPATCHER_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_OPS_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_OPS_HPP

#include <ops/dispatcher.hpp>

Expand All @@ -17,3 +17,5 @@ using inflate_t = typename api_dispatcher_t<api, path, operation_e::inflate>::im
template <api_e api, path_e path>
using crc64_t = typename api_dispatcher_t<api, path, operation_e::crc64>::impl_t;
} // namespace bench::ops

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_OPS_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/params.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_PARAMS_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_PARAMS_HPP

#include <memory>
#include <types.hpp>
Expand Down Expand Up @@ -61,3 +61,5 @@ struct crc64_params_t {
};

} // namespace bench::ops

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_PARAMS_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/ops/results.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_RESULTS_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_RESULTS_HPP

#include <types.hpp>
#include <utility.hpp>
Expand Down Expand Up @@ -35,3 +35,5 @@ struct crc64_results_t {
data_type_t data_;
};
} // namespace bench::ops

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_OPS_RESULTS_HPP
5 changes: 3 additions & 2 deletions tools/benchmarks/include/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_TYPES_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_TYPES_HPP

#include <cstdint>
#include <string>
Expand Down Expand Up @@ -77,3 +77,4 @@ static inline std::uint32_t operator|(mem_loc_mask_e lha, std::uint32_t rha) {
return static_cast<std::uint32_t>(lha) | rha;
}
} // namespace bench
#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_TYPES_HPP
6 changes: 4 additions & 2 deletions tools/benchmarks/include/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: MIT
******************************************************************************/

#pragma once
#ifndef QPL_TOOLS_BENCHMARKS_INCLUDE_UTILITY_HPP
#define QPL_TOOLS_BENCHMARKS_INCLUDE_UTILITY_HPP

#include <algorithm> // vector search
#include <cstdint>
Expand Down Expand Up @@ -335,3 +335,5 @@ static inline std::vector<huffman_type_e> to_huffman_type(const std::vector<std:
}

} // namespace bench

#endif // QPL_TOOLS_BENCHMARKS_INCLUDE_UTILITY_HPP

0 comments on commit fab4571

Please sign in to comment.