24#ifndef TVM_TOPI_CONTRIB_CUBLAS_H_
25#define TVM_TOPI_CONTRIB_CUBLAS_H_
35using namespace topi::detail;
47 auto n =
transa ? lhs->shape[1] : lhs->shape[0];
48 auto m =
transb ? rhs->shape[0] : rhs->shape[1];
51 {{
n,
m}}, {lhs->GetDataType()}, {lhs, rhs},
52 [&](ffi::Array<BufferVar>
ins, ffi::Array<BufferVar>
outs) {
72 auto b = lhs->shape[0];
73 auto n =
transa ? lhs->shape[2] : lhs->shape[1];
74 auto m =
transb ? rhs->shape[1] : rhs->shape[2];
77 {{b,
n,
m}}, {lhs->GetDataType()}, {lhs, rhs},
78 [&](ffi::Array<BufferVar>
ins, ffi::Array<BufferVar>
outs) {
79 return call_packed({
prim::StringImm(
"tvm.contrib.cublas.batch_matmul"), pack_buffer(
ins[0]),
static IntImm Int32(int64_t value, Span span=Span())
Construct a scalar int32 constant.
Definition expr.h:528
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
Managed reference to StringImmNode.
Definition expr.h:68
Tensor structure representing a possible input, or intermediate computation result.
Definition tensor.h:98
Helpers for using external functions.
Tensor expression language DSL.
Definition extracted_task.h:33
Tensor cublas_matmul(const Tensor &lhs, const Tensor &rhs, bool transa, bool transb)
Create an op that multiplies lhs and rhs with cuBLAS.
Definition cublas.h:46
Tensor cublas_batch_matmul(const Tensor &lhs, const Tensor &rhs, bool transa, bool transb)
Create an op that multiplies batch matrices lhs and rhs with cuBLAS.
Definition cublas.h:71
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
Operation node can generate one or multiple Tensors.