MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EvalRuy

Method EvalRuy

tensorflow/lite/experimental/ruy/test.h:579–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577
578template <typename LhsScalar, typename RhsScalar, typename SpecType>
579void TestSet<LhsScalar, RhsScalar, SpecType>::EvalRuy(TestResultType* result) {
580 GlobalContext().explicit_tuning = result->tuning;
581 if (max_num_threads) {
582 GlobalContext().max_num_threads = max_num_threads;
583 } else if (benchmark) {
584 GlobalContext().max_num_threads = 1;
585 } else {
586 GlobalContext().max_num_threads = 1 + global_random_engine()() % 8;
587 }
588 GlobalContext().SetRuntimeEnabledPaths(result->path);
589 if (expected_outcome == ExpectedOutcome::kSuccess) {
590 DoMul(result);
591 RUY_CHECK(GlobalContext().last_taken_path == result->path);
592 } else if (expected_outcome == ExpectedOutcome::kDeath) {
593 // TODO(benoitjacob) TSan and ASan seem to be breaking ASSERT_DEATH.
594 // Report a bug?
595#if (!defined NDEBUG) && (!defined RUY_ASAN) && (!defined RUY_TSAN)
596 ASSERT_DEATH(DoMul(result), "");
597#endif
598 } else {
599 RUY_CHECK(false);
600 }
601 GlobalContext().explicit_tuning = Tuning::kAuto;
602 GlobalContext().max_num_threads = 1;
603}
604
605#ifdef RUY_TEST_EXTERNAL_PATHS
606

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected