FastLED 3.10.9
Loading...
Searching...
No Matches

◆ benchFloat4()

template<typename Op>
int64_t autoresearch::simd_check::benchFloat4 ( int iters,
Op op )
inline

Definition at line 1135 of file AutoResearchSimd.h.

1135 {
1136 float a0 = 1.5f, a1 = 2.3f, a2 = 0.7f, a3 = 3.1f;
1137 float b0 = 0.5f, b1 = 1.2f, b2 = 2.0f, b3 = 0.9f;
1138 uint32_t t0 = fl::micros();
1139 for (int i = 0; i < iters; i++) {
1140 a0 = op(a0, b0); a1 = op(a1, b1);
1141 a2 = op(a2, b2); a3 = op(a3, b3);
1142 b0 = a0 + 0.001f; b1 = a1 + 0.001f;
1143 b2 = a2 + 0.001f; b3 = a3 + 0.001f;
1144 }
1145 uint32_t t1 = fl::micros();
1146 uint32_t tmp; fl::memcpy(&tmp, &a0, sizeof(tmp));
1147 simdBenchmarkState().sink = tmp;
1148 return static_cast<int64_t>(t1 - t0);
1149}
SimdBenchmarkState & simdBenchmarkState()
fl::u32 micros() FL_NO_EXCEPT
Universal microsecond timer - returns microseconds since system startup.
FASTLED_FORCE_INLINE void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
Definition cstring.h:136

References fl::memcpy(), fl::micros(), simdBenchmarkState(), and autoresearch::simd_check::SimdBenchmarkState::sink.

Referenced by runMultiplyBenchmark().

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