Skip to content

Commit 0de593c

Browse files
authored
chore: minor config changes, dep updates and general maintenance (#83)
1 parent d6c7689 commit 0de593c

File tree

13 files changed

+60
-39
lines changed

13 files changed

+60
-39
lines changed

.clangd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Diagnostics:
2+
MissingIncludes: Strict
3+
UnusedIncludes: Strict
4+
CompileFlags:
5+
CompilationDatabase: ./out/build/x64-debug-clang

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
22

33
# ---- Project ----
44

CMakePresets.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"binaryDir": "${sourceDir}/out/build/${presetName}",
2828
"installDir": "${sourceDir}/out/install/${presetName}",
2929
"cacheVariables": {
30-
"CMAKE_CXX_COMPILER": "cl"
30+
"CMAKE_CXX_COMPILER": "cl",
31+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
3132
},
3233
"condition": {
3334
"type": "equals",
@@ -105,7 +106,8 @@
105106
{
106107
"name": "x64-debug",
107108
"displayName": "x64 Debug",
108-
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
109+
"description":
110+
"Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
109111
"inherits": "windows-base",
110112
"architecture": {
111113
"value": "x64",
@@ -139,7 +141,8 @@
139141
{
140142
"name": "x64-release",
141143
"displayName": "x64 Release",
142-
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Release)",
144+
"description":
145+
"Target Windows (64-bit) with the Visual Studio development environment. (Release)",
143146
"inherits": "x64-debug",
144147
"cacheVariables": {
145148
"CMAKE_BUILD_TYPE": "Release"
@@ -148,7 +151,8 @@
148151
{
149152
"name": "x64-release-with-debug",
150153
"displayName": "x64 Release w/Debug",
151-
"description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
154+
"description":
155+
"Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
152156
"inherits": "x64-debug",
153157
"cacheVariables": {
154158
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
@@ -167,4 +171,4 @@
167171
}
168172
}
169173
]
170-
}
174+
}

benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
22

33
project(thread-pool-benchmarks LANGUAGES CXX)
44

benchmark/source/matrix_multiplication.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@
33
#include <thread_pool/thread_pool.h>
44

55
#include <BS_thread_pool_light.hpp>
6+
#include <chrono>
67
#include <concepts>
8+
#include <cstddef>
79
#include <fstream>
10+
#include <function2/function2.hpp>
11+
#include <functional>
812
#include <future>
913
#include <riften/thiefpool.hpp>
14+
#include <string>
1015
#include <task_thread_pool.hpp>
16+
#include <thread>
17+
#include <type_traits>
18+
#include <vector>
1119

1220
#include "utilities.h"
1321

benchmark/source/thread_pool_scaling.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <chrono>
66
#include <riften/thiefpool.hpp>
7+
#include <string>
78
#include <thread>
89

910
inline void thread_task() {

documentation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
22

33
project(ThreadPoolDocs)
44

examples/mandelbrot/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
22

33
project(Mandelbrot LANGUAGES CXX)
44

examples/mandelbrot/include/fractal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ struct fractal_window {
3333
/// @brief Performs smooth polynomial fitting to the given value.
3434
rgb get_rgb_smooth(int n, int iter_max);
3535

36-
void save_ppm(const unsigned int &width, const unsigned int &height, std::span<rgb> colors,
36+
void save_ppm(const unsigned int& width, const unsigned int& height, std::span<rgb> colors,
3737
std::string_view file_name);
3838
/**
3939
* @brief Convert a pixel coordinate to the complex domain
4040
* @param scr Source domain (viewing window)
4141
* @param fr Fractal domain (real and imaginary range)
4242
* @param c Initial complex value
4343
*/
44-
complex scale(const fractal_window<int> &scr, const fractal_window<double> &fr, complex c);
44+
complex scale(const fractal_window<int>& scr, const fractal_window<double>& fr, complex c);
4545

4646
/**
4747
* @brief Check if a point is in the set or escapes to infinity, return the number if iterations
4848
* @param c Complex number value, see scale
4949
* @param iter_max Max number of iterations
5050
* @param func The complex function used for the fractal.
5151
*/
52-
int escape(complex c, int iter_max, const std::function<complex(complex, complex)> &func);
52+
int escape(complex c, int iter_max, const std::function<complex(complex, complex)>& func);
5353

5454
/**
5555
* @brief Calculate a single fractal row and returns it's color values.

examples/mandelbrot/source/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void mandelbrot_threadpool(int image_width, int image_height, int max_iterations
4141
colors.reserve(source.size());
4242

4343
// copy data to output vector
44-
for (auto &future : futures) {
44+
for (auto& future : futures) {
4545
auto data = future.get();
4646
colors.insert(colors.end(), data.begin(), data.end());
4747
}
@@ -56,7 +56,7 @@ void mandelbrot_threadpool(int image_width, int image_height, int max_iterations
5656
save_ppm(source.width(), source.height(), colors, output_file_name);
5757
}
5858

59-
auto main(int argc, char **argv) -> int {
59+
auto main(int argc, char** argv) -> int {
6060
cxxopts::Options options(*argv, "Generate a mandelbrot ppm image using a thread pool!");
6161

6262
int image_size;
@@ -83,7 +83,7 @@ auto main(int argc, char **argv) -> int {
8383

8484
mandelbrot_threadpool(image_size, image_size, max_iterations, output_file_name);
8585

86-
} catch (const cxxopts::exceptions::exception &e) {
86+
} catch (const cxxopts::exceptions::exception& e) {
8787
std::cout << "error parsing options: " << e.what() << std::endl;
8888
exit(1);
8989
}

0 commit comments

Comments
 (0)