MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / extract_function_name_from_compile

Function extract_function_name_from_compile

export_hf.py:139–152  ·  view source on GitHub ↗

Extract the function name passed to compile_cuda(). Looks for patterns like: compile_cuda(CUDA_SRC, "matmul_cuda") compile_cuda(CUDA_SRC, "softmax_cuda")

(source: str)

Source from the content-addressed store, hash-verified

137
138
139def extract_function_name_from_compile(source: str) -> Optional[str]:
140 """
141 Extract the function name passed to compile_cuda().
142
143 Looks for patterns like:
144 compile_cuda(CUDA_SRC, "matmul_cuda")
145 compile_cuda(CUDA_SRC, "softmax_cuda")
146 """
147 match = re.search(
148 r'compile_cuda\s*\(\s*CUDA_SRC\s*,\s*["\'](\w+)["\']', source
149 )
150 if match:
151 return match.group(1)
152 return None
153
154
155# ---------------------------------------------------------------------------

Callers 1

_export_cuda_kernelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected