Skip to content

Commit

Permalink
target: fix ASTBuilder.get_function_declaration annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Apr 13, 2024
1 parent d1437f3 commit 52abd21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion loopy/target/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def get_function_definition(
def get_function_declaration(
self, codegen_state: CodeGenerationState,
codegen_result: CodeGenerationResult, schedule_index: int
) -> Tuple[Sequence[Tuple[str, str]], ASTType]:
) -> Tuple[Sequence[Tuple[str, str]], Optional[ASTType]]:
"""Returns preambles and the AST for the function declaration."""
raise NotImplementedError

Expand Down
6 changes: 3 additions & 3 deletions loopy/target/pyopencl.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def generate_value_arg_setup(

from genpy import If, Raise, Statement as S, Suite

result: List[str] = []
result: List[genpy.Generable] = []
gen = result.append

buf_indices_and_args = []
Expand Down Expand Up @@ -717,7 +717,7 @@ def generate_array_arg_setup(
from loopy.kernel.array import ArrayBase
from genpy import Statement as S, Suite

result: List[str] = []
result: List[genpy.Generable] = []
gen = result.append

cl_indices_and_args: List[Union[int, str]] = []
Expand Down Expand Up @@ -787,7 +787,7 @@ def get_function_definition(
def get_function_declaration(
self, codegen_state: CodeGenerationState,
codegen_result: CodeGenerationResult, schedule_index: int
) -> Tuple[Sequence[Tuple[str, str]], genpy.Generable]:
) -> Tuple[Sequence[Tuple[str, str]], Optional[genpy.Generable]]:
# no such thing in Python
return [], None

Expand Down
4 changes: 2 additions & 2 deletions loopy/target/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
THE SOFTWARE.
"""

from typing import Tuple, Sequence
from typing import Optional, Sequence, Tuple

from pymbolic.mapper import Mapper
from pymbolic.mapper.stringifier import StringifyMapper
Expand Down Expand Up @@ -169,7 +169,7 @@ def ast_module(self):
def get_function_declaration(
self, codegen_state: CodeGenerationState,
codegen_result: CodeGenerationResult, schedule_index: int
) -> Tuple[Sequence[Tuple[str, str]], None]:
) -> Tuple[Sequence[Tuple[str, str]], Optional[Generable]]:
return [], None

def get_function_definition(self, codegen_state, codegen_result,
Expand Down

0 comments on commit 52abd21

Please sign in to comment.