Build a LittleKernel kernel with standard passes.
(kernel_func, grid, block, shared_mem_bytes=0, arch=None, verbose=False)
| 95 | |
| 96 | |
| 97 | def build_kernel(kernel_func, grid, block, shared_mem_bytes=0, arch=None, verbose=False): |
| 98 | """Build a LittleKernel kernel with standard passes.""" |
| 99 | passes = PASSES["cuda"] |
| 100 | if arch is None: |
| 101 | cap = torch.cuda.get_device_capability() |
| 102 | arch = f"sm_{cap[0]}{cap[1]}" |
| 103 | return kernel_func.build( |
| 104 | passes, |
| 105 | codegen_cuda, |
| 106 | grid=grid, |
| 107 | block=block, |
| 108 | shared_mem_bytes=shared_mem_bytes, |
| 109 | arch=arch, |
| 110 | verbose=verbose, |
| 111 | ) |
| 112 | |
| 113 | |
| 114 | def compile_kernel(kernel_func): |
no test coverage detected