MCPcopy Create free account
hub / github.com/KnowingNothing/MatmulTutorial / compile_kernel

Function compile_kernel

examples/matmul/this-sm100/level3/test.py:18–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17
18def compile_kernel():
19 cmd = ["nvcc", "--shared", "-Xcompiler", "-fPIC",
20 "-gencode", "arch=compute_100a,code=sm_100a", "-O3",
21 KERNEL_PATH, "-o", SO_PATH, "-lcuda"]
22 print(f"Compiling: {' '.join(cmd)}")
23 r = subprocess.run(cmd, capture_output=True, text=True)
24 if r.returncode != 0:
25 print("STDOUT:", r.stdout)
26 print("STDERR:", r.stderr)
27 sys.exit(1)
28 print("OK")
29
30
31def cosine_similarity(x: torch.Tensor, y: torch.Tensor) -> float:

Callers 1

test.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected