Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/generate_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

def build_cpp_function_index(root_path):
func_index = {}
extensions = {'.cpp', '.cc', '.cxx', '.c', '.hpp', '.h'}
# Include CUDA sources/headers: bound functions in this project may be
# defined in `.cu` or declared in `.cuh`, and the `is_header` check below
# already treats `.cuh` as a header. Without them such functions are missed
# and fall back to a generic `(*args, **kwargs) -> Any` stub.
extensions = {'.cpp', '.cc', '.cxx', '.c', '.cu', '.hpp', '.h', '.cuh'}

pattern = re.compile(
r'([\w:\s*<&>,\[\]\(\)]+?)'
Expand Down Expand Up @@ -153,7 +157,7 @@ def extract_m_def_statements(root_path):
Scan all c files under root_path and extract all m.def(...) statements.
"""
results = []
extensions = {'.hpp', '.cpp', '.h', '.cc'}
extensions = {'.hpp', '.cpp', '.h', '.cc', '.cu', '.cuh'}
Comment on lines 157 to +160

# Regex: match m.def( ... ), supports multi-line
pattern = re.compile(r'm\.def\s*\(')
Expand Down