update flags again

This commit is contained in:
2026-02-24 20:53:27 +01:00
parent 349d614611
commit f31f9557b3
5 changed files with 35 additions and 16 deletions

View File

@ -33,6 +33,10 @@
// - g++/clang++ -lunwind
// #define BACKWARD_HAS_LIBUNWIND 1
#include "config.hpp"
#ifdef BACKWARD
#include "backward.hpp"
namespace backward {
@ -40,3 +44,5 @@ namespace backward {
backward::SignalHandling sh;
} // namespace backward
#endif

View File

@ -1,7 +1,6 @@
#include "physics.hpp"
#include "config.hpp"
#include <BS_thread_pool.hpp>
#include <algorithm>
#include <cfloat>
#include <chrono>
@ -11,6 +10,11 @@
#include <utility>
#include <vector>
#ifdef THREADPOOL
#define BS_THREAD_POOL_NATIVE_EXTENSIONS
#include <BS_thread_pool.hpp>
#endif
#ifdef TRACY
#include "tracy.hpp"
#include <tracy/Tracy.hpp>
@ -116,9 +120,11 @@ auto MassSpringSystem::CalculateSpringForces() -> void {
}
}
#ifdef THREADPOOL
auto MassSpringSystem::SetThreadName(std::size_t idx) -> void {
BS::this_thread::set_os_thread_name(std::format("bh-worker-{}", idx));
}
#endif
auto MassSpringSystem::BuildOctree() -> void {
#ifdef TRACY
@ -170,14 +176,14 @@ auto MassSpringSystem::CalculateRepulsionForces() -> void {
};
// Calculate forces using Barnes-Hut
#ifdef WEB
for (int i = 0; i < mass_pointers.size(); ++i) {
solve_octree(i);
}
#else
#ifdef THREADPOOL
BS::multi_future<void> loop_future =
threads.submit_loop(0, masses.size(), solve_octree, 256);
loop_future.wait();
#else
for (std::size_t i = 0; i < masses.size(); ++i) {
solve_octree(i);
}
#endif
}
@ -193,7 +199,9 @@ auto MassSpringSystem::VerletUpdate(float delta_time) -> void {
auto ThreadedPhysics::PhysicsThread(ThreadedPhysics::PhysicsState &state)
-> void {
#ifdef THREADPOOL
BS::this_thread::set_os_thread_name("physics");
#endif
MassSpringSystem mass_springs;