FastLED 3.10.8
Loading...
Searching...
No Matches

◆ runSimdTests()

int autoresearch::simd_check::runSimdTests ( )
inline

Run the full SIMD test suite. Returns the number of failures.

Definition at line 1402 of file AutoResearchSimd.h.

1402 {
1403 const SimdTestEntry* tests = nullptr;
1404 int num_tests = 0;
1405 getTests(&tests, &num_tests);
1406
1407 int passed = 0;
1408 int failed = 0;
1409
1410 FL_PRINT("\n[SIMD AUTORESEARCH]");
1411 FL_PRINT("────────────────────────────────────────────────────────────────");
1412
1413#if defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || defined(_M_IX86)
1414 FL_PRINT(" SIMD Backend: x86 SSE2");
1415#elif defined(__XTENSA__) && FL_XTENSA_HAS_PIE
1416 FL_PRINT(" SIMD Backend: Xtensa PIE (ESP32-S3)");
1417#elif defined(__XTENSA__)
1418 FL_PRINT(" SIMD Backend: Xtensa scalar");
1419#elif defined(__riscv)
1420 FL_PRINT(" SIMD Backend: RISC-V scalar");
1421#else
1422 FL_PRINT(" SIMD Backend: Scalar fallback");
1423#endif
1424
1425 fl::sstream ss;
1426 ss << " Running " << num_tests << " SIMD tests...\n";
1427 FL_PRINT(ss.str());
1428
1429 for (int i = 0; i < num_tests; i++) {
1430 bool ok = tests[i].func();
1431 if (ok) {
1432 passed++;
1433 ss.clear();
1434 ss << " [PASS] " << tests[i].name;
1435 FL_PRINT(ss.str());
1436 } else {
1437 failed++;
1438 ss.clear();
1439 ss << " [FAIL] " << tests[i].name;
1440 FL_ERROR(ss.str());
1441 }
1442 }
1443
1444 ss.clear();
1445 ss << "\n[SIMD RESULTS] " << passed << "/" << num_tests << " passed";
1446 if (failed > 0) {
1447 ss << ", " << failed << " FAILED";
1448 FL_ERROR(ss.str());
1449 } else {
1450 ss << " - ALL PASSED";
1451 FL_PRINT(ss.str());
1452 }
1453
1454 return failed;
1455}
void clear() FL_NO_EXCEPT
Definition strstream.h:366
string str() const FL_NO_EXCEPT
Definition strstream.h:43
#define FL_ERROR(...)
Definition log.h:373
#define FL_PRINT(...)
Definition log.h:629
void getTests(const SimdTestEntry **out_tests, int *out_count)
Get the static test table. Used by both runSimdTests() and the RPC handler.

References fl::sstream::clear(), FL_ERROR, FL_PRINT, autoresearch::simd_check::SimdTestEntry::func, getTests(), autoresearch::simd_check::SimdTestEntry::name, and fl::sstream::str().

+ Here is the call graph for this function: