FastLED 3.9.15
Loading...
Searching...
No Matches

◆ test_add_f32_4()

void simd_test::test_add_f32_4 ( TestResult & result)

Definition at line 296 of file simd_tests.cpp.

296 {
297 float a_data[4] = {1.0f, 2.0f, 3.0f, 4.0f};
298 float b_data[4] = {0.5f, 1.5f, 2.5f, 3.5f};
299 float expected[4] = {1.5f, 3.5f, 5.5f, 7.5f};
300 float output[4] = {0.0f};
301
302 simd_f32x4 a = load_f32_4(a_data);
303 simd_f32x4 b = load_f32_4(b_data);
304 simd_f32x4 c = add_f32_4(a, b);
305 store_f32_4(output, c);
306
307 if (!compare_f32_arrays(expected, output, 4)) {
308 result.fail("Float add operation produced incorrect results");
309 }
310}
platforms::simd_f32x4 simd_f32x4
Definition types.h:27
expected< T, E > result
Alias for expected (Rust-style naming)
Definition result.h:31
bool compare_f32_arrays(const float *a, const float *b, size_t count, float epsilon)
Compare two float arrays element-wise with epsilon tolerance.

References compare_f32_arrays().

Referenced by setup().

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