fixing optimizer and concurrency::reduce

This commit is contained in:
tamasmeszaros 2020-08-31 18:53:44 +02:00
parent c193d7c930
commit c10ff4f503
6 changed files with 142 additions and 41 deletions

View file

@ -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));
}