| 888 | } |
| 889 | } |
| 890 | void Variable::prepareCompute(const std::vector<VARP>& vars, bool forceCpu) { |
| 891 | std::vector<EXPRP> exprs; |
| 892 | for (auto v : vars) { |
| 893 | if (nullptr != v && nullptr != v->mFrom->get()) { |
| 894 | if (!v->expr().first->visited() && nullptr == v->expr().first->inside()->mCache) { |
| 895 | v->expr().first->requireInfo(); |
| 896 | v->expr().first->setVisited(true); |
| 897 | exprs.emplace_back(v->expr().first); |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | for (auto v : vars) { |
| 902 | if (nullptr != v && nullptr != v->mFrom->get()) { |
| 903 | v->expr().first->setVisited(false); |
| 904 | } |
| 905 | } |
| 906 | if (exprs.empty()) { |
| 907 | return; |
| 908 | } |
| 909 | ExecutorScope::Current()->makeCache(std::move(exprs), forceCpu); |
| 910 | } |
| 911 | |
| 912 | void Variable::compute(const std::vector<VARP>& vars, bool forceCPU) { |
| 913 | prepareCompute(vars, forceCPU); |
nothing calls this directly
no test coverage detected