MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / gen_opr_ast

Function gen_opr_ast

src/jit/impl/nvrtc/codegen_cuda.cpp:102–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102ASTPtr 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
117std::pair<std::string, std::string> mgb::jit::codegen_cuda(

Callers 1

codegen_cudaMethod · 0.70

Calls 3

inputMethod · 0.45
push_backMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected