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)
| 137 | |
| 138 | |
| 139 | def 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 | # --------------------------------------------------------------------------- |
no outgoing calls
no test coverage detected