MCPcopy Create free account
hub / github.com/MegEngine/MegCC / CreateCompute

Method CreateCompute

compiler/lib/CodeGen/Matmul.cpp:63–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void MatmulKernel::CreateCompute(
64 Block* entryBlock, mlir::OpBuilder& op_builder, mlir::MLIRContext* ctx,
65 TContext* context) const {
66 Value input_a = entryBlock->getArgument(0);
67 Value input_b = entryBlock->getArgument(1);
68 Value output_c = entryBlock->getArgument(2);
69
70 SmallVector<Value> inputs_val;
71 SmallVector<Value> outputs_val;
72 inputs_val.push_back(input_a);
73 inputs_val.push_back(input_b);
74 outputs_val.push_back(output_c);
75
76 op_builder.create<linalg::MatmulOp>(
77 op_builder.getUnknownLoc(), inputs_val, outputs_val);
78 std::vector<Value> results;
79 op_builder.create<ReturnOp>(op_builder.getUnknownLoc(), results);
80}
81
82void MatmulKernel::CreatePass(
83 mlir::PassManager& pm, mlir::MLIRContext* ctx, TContext* context) const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected