MCPcopy Create free account
hub / github.com/NVIDIA/SOL-ExecBench / run

Function run

examples/cutlass/gemm/main.cpp:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "kernel.h"
4
5torch::Tensor run(const torch::Tensor& A, const torch::Tensor& B) {
6 TORCH_CHECK(A.dim() == 2 && B.dim() == 2, "inputs must be 2D");
7 TORCH_CHECK(A.size(1) == B.size(0), "inner dimensions must match");
8 TORCH_CHECK(A.is_cuda() && B.is_cuda(), "inputs must be CUDA tensors");
9 TORCH_CHECK(A.scalar_type() == torch::kFloat32, "A must be float32");
10 TORCH_CHECK(B.scalar_type() == torch::kFloat32, "B must be float32");
11 TORCH_CHECK(A.is_contiguous() && B.is_contiguous(), "inputs must be contiguous");
12
13 auto C = torch::empty({A.size(0), B.size(1)}, A.options());
14 cudaStream_t current = at::cuda::getCurrentCUDAStream();
15 gemm_launcher(C, A, B, current);
16 return C;
17}
18
19PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
20 m.def("run", &run, "CUTLASS GEMM");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected