| 421 | } |
| 422 | |
| 423 | int test_concat(const char* test_node_name, const std::vector<ConcatInputParam>& inputParam, int layout, int data_type) |
| 424 | { |
| 425 | graph_t graph = create_test_graph(test_node_name, inputParam, layout, data_type); |
| 426 | graph_t graph1 = create_test_graph(test_node_name, inputParam, layout, 0); |
| 427 | if(graph == nullptr || graph1 == nullptr) |
| 428 | { |
| 429 | std::cout << "create graph failed!!!\n"; |
| 430 | return 1; |
| 431 | } |
| 432 | |
| 433 | set_input_data(graph, ( int )inputParam.size()); |
| 434 | set_input_data(graph1, ( int )inputParam.size()); |
| 435 | |
| 436 | setenv("OPS_REGISTRY", "reference", 1); |
| 437 | setenv("OP_NAME", "Permute", 1); |
| 438 | if(prerun_graph(graph) < 0) |
| 439 | { |
| 440 | std::cerr << "prerun_graph failed: ERRNO: " << get_tengine_errno() << "\n"; |
| 441 | return 1; |
| 442 | } |
| 443 | |
| 444 | unsetenv("OPS_REGISTRY"); |
| 445 | unsetenv("OP_NAME"); |
| 446 | |
| 447 | if(prerun_graph(graph1) < 0) |
| 448 | { |
| 449 | std::cerr << "prerun_graph failed: ERRNO: " << get_tengine_errno() << "\n"; |
| 450 | return 1; |
| 451 | } |
| 452 | |
| 453 | if(run_graph(graph, 1) < 0 || run_graph(graph1, 1) < 0) |
| 454 | { |
| 455 | std::cerr << "run_graph failed: ERRNO: " << get_tengine_errno() << "\n"; |
| 456 | return 2; |
| 457 | } |
| 458 | |
| 459 | node_t node_1 = get_graph_node(graph, test_node_name); |
| 460 | node_t node_2 = get_graph_node(graph1, test_node_name); |
| 461 | int ret = 0; |
| 462 | ret = comp_res(node_1, node_2, data_type); |
| 463 | |
| 464 | release_graph_node(node_1); |
| 465 | release_graph_node(node_2); |
| 466 | |
| 467 | postrun_graph(graph); |
| 468 | |
| 469 | destroy_graph(graph); |
| 470 | |
| 471 | release_all_mem(); |
| 472 | |
| 473 | return ret; |
| 474 | } |
| 475 | |
| 476 | #define __PUSH_PARAM__(_n, _c, _h, _w) \ |
| 477 | { \ |
no test coverage detected