FastLED 3.10.6
Loading...
Searching...
No Matches

◆ makeBenchSim()

fl::unique_ptr< WaveSimulation2D_Real > fl::wave_perf::makeBenchSim ( u32 W,
u32 H,
LaplacianStencil stencil )
inline

Definition at line 61 of file wave_perf_bench.h.

62 {
63 auto sim = fl::make_unique<WaveSimulation2D_Real>(W, H, 0.16f, 6.0f);
64 sim->setHalfDuplex(false);
65 sim->setStencil(stencil);
66 for (u32 y = 0; y < H; ++y) {
67 for (u32 x = 0; x < W; ++x) {
68 sim->setf(static_cast<fl::size>(x),
69 static_cast<fl::size>(y),
70 ((x + y) & 1u) ? -0.5f : 0.5f);
71 }
72 }
73 sim->update(); // warm-up: prime caches, get past init quirks
74 return sim;
75}
static const int H
Definition PerfDisc.ino:21
static const int W
Definition PerfDisc.ino:20
fl::enable_if<!fl::is_array< T >::value, unique_ptr< T > >::type make_unique(Args &&... args) FL_NO_EXCEPT
Definition unique_ptr.h:261

References fl::FL_NO_EXCEPT, H, fl::make_unique(), W, fl::x, and fl::y.

Referenced by runWavePerf(), runWavePerfLoadsOnly(), and runWavePerfRepeat().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: