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

Method exec

dnn/src/cuda/batched_matrix_mul/brute_force.cpp:66–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 config.first[0], config.first[1], config.first[2]);
65}
66void BatchedMatrixMulForwardImpl::AlgoBruteForce::exec(const ExecArgs& args) const {
67 auto N = args.layout_a.shape[0];
68 auto config = prepare_sub_opr(args);
69
70 rep(n, N) {
71 TensorND A_, B_, C_;
72 auto tensor_n_from_batch = [n](const TensorND& in, TensorND& out) {
73 out.reset_ptr(static_cast<void*>(
74 static_cast<dt_byte*>(in.raw_ptr()) +
75 n * in.layout.stride[0] * in.layout.dtype.size()));
76 out.layout = in.layout.remove_axis(0);
77 };
78 tensor_n_from_batch(args.tensor_a, A_);
79 tensor_n_from_batch(args.tensor_b, B_);
80 tensor_n_from_batch(args.tensor_c, C_);
81 config.second->exec(A_, B_, C_, args.workspace);
82 }
83}

Callers 1

repFunction · 0.45

Calls 1

prepare_sub_oprFunction · 0.70

Tested by

no test coverage detected