| 571 | } |
| 572 | |
| 573 | void test_gather_other(CompNode cn0, CompNode cn1) { |
| 574 | if (cn0.get_mem_status_bytes().second > cn1.get_mem_status_bytes().second) { |
| 575 | std::swap(cn0, cn1); |
| 576 | } |
| 577 | size_t elems = cn0.get_mem_status_bytes().second * 2 / 5 / sizeof(dt_int32); |
| 578 | auto xv = std::make_shared<DeviceTensorND>(cn0, TensorShape{elems}, dtype::Int32()); |
| 579 | auto graph = ComputingGraph::make(); |
| 580 | auto x = opr::SharedDeviceTensor::make(*graph, xv), x1 = x + 1, |
| 581 | x2 = opr::MarkDynamicVar::make(x), y = opr::Copy::make(x1, {cn1}); |
| 582 | // x1 must be released (which requires y to finish) before x2 succeeds |
| 583 | |
| 584 | set_priority(x1, -10); |
| 585 | set_priority(y, -10); |
| 586 | graph->options().var_sanity_check_first_run = false; |
| 587 | graph->options().async_exec_level = 0; |
| 588 | auto func = graph->compile({{x2, {}}, {y, {}}}); |
| 589 | opr::Sleep::sleep(cn1, 0.7); |
| 590 | func->execute(); |
| 591 | } |
| 592 | } // namespace |
| 593 | |
| 594 | #if MGB_CUDA |
no test coverage detected