FastLED 3.10.9
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 1403 of file AutoResearchSimd.h.

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