mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-08 06:24:01 -06:00
fixing optimizer and concurrency::reduce
This commit is contained in:
parent
c193d7c930
commit
c10ff4f503
6 changed files with 142 additions and 41 deletions
|
@ -5,6 +5,7 @@
|
|||
#include "sla_test_utils.hpp"
|
||||
|
||||
#include <libslic3r/SLA/SupportTreeMesher.hpp>
|
||||
#include <libslic3r/SLA/Concurrency.hpp>
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -239,3 +240,14 @@ TEST_CASE("halfcone test", "[halfcone]") {
|
|||
m.require_shared_vertices();
|
||||
m.WriteOBJFile("Halfcone.obj");
|
||||
}
|
||||
|
||||
TEST_CASE("Test concurrency")
|
||||
{
|
||||
std::vector<double> vals = grid(0., 100., 10.);
|
||||
|
||||
double ref = std::accumulate(vals.begin(), vals.end(), 0.);
|
||||
|
||||
double s = sla::ccr_par::reduce(vals.begin(), vals.end(), 0., std::plus<double>{});
|
||||
|
||||
REQUIRE(s == Approx(ref));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue