Skip to content

Commit d525bd4

Browse files
majosminducer
authored andcommitted
fix typing in make_loopy_program
1 parent 298de04 commit d525bd4

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

arraycontext/loopy.py

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,33 @@
11
"""
22
.. currentmodule:: arraycontext
33
.. autofunction:: make_loopy_program
4+
5+
References
6+
----------
7+
8+
.. class:: InstructionBase
9+
10+
See :class:`loopy.InstructionBase`.
11+
12+
.. class:: SubstitutionRule
13+
14+
See :class:`loopy.SubstitutionRule`.
15+
16+
.. class:: ValueArg
17+
18+
See :class:`loopy.ValueArg`.
19+
20+
.. class:: ArrayArg
21+
22+
See :class:`loopy.ArrayArg`.
23+
24+
.. class:: TemporaryVariable
25+
26+
See :class:`loopy.TemporaryVariable`.
27+
28+
.. class:: EllipsisType
29+
30+
See :data:`types.EllipsisType`.
431
"""
532
from __future__ import annotations
633

@@ -42,7 +69,19 @@
4269

4370

4471
if TYPE_CHECKING:
45-
from collections.abc import Mapping
72+
from collections.abc import Mapping, Sequence
73+
from types import EllipsisType
74+
75+
import islpy as isl
76+
77+
from loopy.kernel.data import (
78+
ArrayArg,
79+
SubstitutionRule,
80+
TemporaryVariable,
81+
ValueArg,
82+
)
83+
from loopy.kernel.instruction import InstructionBase
84+
from pytools.tag import ToTagSetConvertible
4685

4786

4887
# {{{ loopy
@@ -52,8 +91,14 @@
5291
return_dict=True)
5392

5493

55-
def make_loopy_program(domains, statements, kernel_data=None,
56-
name="mm_actx_kernel", tags=None):
94+
def make_loopy_program(
95+
domains: str | Sequence[str | isl.BasicSet],
96+
statements: str | Sequence[InstructionBase | SubstitutionRule | str],
97+
kernel_data: Sequence[
98+
ValueArg | ArrayArg | TemporaryVariable | EllipsisType | str
99+
] | None = None,
100+
name: str = "mm_actx_kernel",
101+
tags: ToTagSetConvertible = None):
57102
"""Return a :class:`loopy.LoopKernel` suitable for use with
58103
:meth:`ArrayContext.call_loopy`.
59104
"""

0 commit comments

Comments
 (0)