| 100 | } |
| 101 | |
| 102 | ASTPtr gen_opr_ast(cg::OperatorNodeBase* opr, const VarNode2AST& var2ast) { |
| 103 | ASTPtrArray cur_inputs; |
| 104 | for (auto inp_node : opr->input()) { |
| 105 | cur_inputs.push_back(var2ast.at(inp_node)); |
| 106 | } |
| 107 | if (opr->same_type<opr::Reduce>() || opr->same_type<opr::GetVarShape>() || |
| 108 | opr->same_type<opr::Dimshuffle>()) { |
| 109 | // Reduce and GetVarShape occur in grad and would be ignored |
| 110 | return {cur_inputs[0]}; |
| 111 | } |
| 112 | |
| 113 | return opr2AST(opr, cur_inputs, CompNode::DeviceType::CUDA).at(0); |
| 114 | } |
| 115 | } // anonymous namespace |
| 116 | |
| 117 | std::pair<std::string, std::string> mgb::jit::codegen_cuda( |
no test coverage detected