| 543 | } |
| 544 | |
| 545 | static bool test_real_chip_query_task(QPilotOSMachine& qvm, const CaseConf &conf) |
| 546 | { |
| 547 | PilotQVM::PilotTaskQueryResult res; |
| 548 | std::string compile_prog; |
| 549 | bool with_compensate = true; |
| 550 | for (size_t test_cnt = 0; test_cnt < 1/*0000*/; ++test_cnt) |
| 551 | { |
| 552 | do |
| 553 | { |
| 554 | qvm.query_task_state(Task_Id, res); |
| 555 | if (res.m_errCode != 0) { |
| 556 | std::cout << "Query error!" << std::endl << "errCode: " << res.m_errCode << std::endl << "errInfo: " << res.m_errInfo << std::endl; |
| 557 | return false; |
| 558 | } |
| 559 | std::this_thread::sleep_for(std::chrono::seconds(1)); |
| 560 | std::cout << "."; |
| 561 | } while ((res.m_state != SUCCESS_STATE) && (res.m_state != FAILED_STATE) && (res.m_state != CANCELED_STATE)); |
| 562 | |
| 563 | std::vector<std::map<std::string, double>> result; |
| 564 | qvm.parse_task_result(res.m_result_vec, result); |
| 565 | std::cout << "\nGot result:\n"; |
| 566 | for (auto res1 : result) |
| 567 | { |
| 568 | for (const auto& val : res1) { |
| 569 | cout << val.first << ": " << val.second << "\n"; |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | return true; |
| 575 | } |
| 576 | |
| 577 | static bool test_real_chip_query_compile_info(QPilotOSMachine& qvm) |
| 578 | { |
nothing calls this directly
no test coverage detected