Skip to content

Commit da547b6

Browse files
Merge branch 'main' into withtag
2 parents 7b60f42 + 82634b7 commit da547b6

116 files changed

Lines changed: 2225 additions & 1945 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ jobs:
5050
- uses: actions/checkout@v4
5151
- name: "Main Script"
5252
run: |
53+
EXTRA_INSTALL="mypy pytest types-colorama types-Pygments"
5354
curl -L -O https://tiker.net/ci-support-v0
5455
. ./ci-support-v0
56+
5557
build_py_project_in_conda_env
56-
python -m pip install mypy
5758
./run-mypy.sh
5859
5960
pytest:
@@ -194,9 +195,9 @@ jobs:
194195
cd /home/firedrake/firedrake/src/firedrake
195196
196197
# patch so exception messages get shown
197-
curl -L https://gist.githubusercontent.com/inducer/17d7134ace215f0df1f3627eac4195c7/raw/63edfaf2ec8bf06987896569a4f24264df490e9e/firedrake-debug-patch.diff | patch -p1
198+
curl -L https://gist.githubusercontent.com/inducer/17d7134ace215f0df1f3627eac4195c7/raw/ec5470a7d8587b6e1f336f3ef1d0ece5e26f236a/firedrake-debug-patch.diff | patch -p1
198199
199-
pytest --tb=native -rsxw --durations=10 -m 'not parallel' tests/multigrid/
200+
pytest --tb=native -rsxw --durations=10 tests/firedrake/regression -k "poisson_strong or stokes_mini or dg_advection"
200201
201202
validate_cff:
202203
name: Validate CITATION.cff

.gitlab-ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,10 @@ Ruff:
158158

159159
Mypy:
160160
script: |
161-
EXTRA_INSTALL="pybind11 numpy"
161+
EXTRA_INSTALL="mypy pybind11 numpy types-colorama types-Pygments"
162162
curl -L -O https://tiker.net/ci-support-v0
163163
. ./ci-support-v0
164164
build_py_project_in_venv
165-
python -m pip install mypy
166165
./run-mypy.sh
167166
tags:
168167
- python3

MANIFEST.in

Lines changed: 0 additions & 23 deletions
This file was deleted.

contrib/c-integer-semantics.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ def main():
9595
func.argtypes = [ctypes.c_longlong, ctypes.c_longlong]
9696
func.restype = ctypes.c_longlong
9797

98-
cdiv = int_exp.cdiv # noqa
99-
cmod = int_exp.cmod # noqa
98+
cmod = int_exp.cmod
10099
int_floor_div = int_exp.loopy_floor_div_int64
101100
int_floor_div_pos_b = int_exp.loopy_floor_div_pos_b_int64
102101
int_mod_pos_b = int_exp.loopy_mod_pos_b_int64

contrib/mem-pattern-explorer/pattern_vis.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, gsize, lsize, subgroup_size=32, decay_constant=0.75):
2727

2828
self.arrays = []
2929

30-
def l(self, index): # noqa: E741,E743
30+
def l(self, index): # noqa: E743
3131
subscript = [np.newaxis] * self.ind_length
3232
subscript[len(self.gsize) + index] = slice(None)
3333

@@ -147,7 +147,7 @@ def get_plot_data(self):
147147
div_ceil(nelements, self.elements_per_row),
148148
self.elements_per_row,)
149149
shaped_array = np.zeros(
150-
base_shape + (self.nattributes,),
150+
(*base_shape, self.nattributes),
151151
dtype=np.float32)
152152
shaped_array.reshape(-1, self.nattributes)[:nelements] = self.array
153153

@@ -160,7 +160,7 @@ def get_plot_data(self):
160160
else:
161161
subgroup.fill(1)
162162

163-
rgb_array = np.zeros(base_shape + (3,))
163+
rgb_array = np.zeros((*base_shape, 3))
164164
if 1:
165165
if len(self.ctx.gsize) > 1:
166166
# g.0 -> red

doc/conf.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from urllib.request import urlopen
33

44

5-
_conf_url = "https://raw.githubusercontent.com/inducer/sphinxconfig/main/sphinxconfig.py" # noqa
5+
_conf_url = "https://raw.githubusercontent.com/inducer/sphinxconfig/main/sphinxconfig.py"
66
with urlopen(_conf_url) as _inf:
77
exec(compile(_inf.read(), _conf_url, "exec"), globals())
88

@@ -35,20 +35,6 @@
3535
"pyrsistent": ("https://pyrsistent.readthedocs.io/en/latest/", None),
3636
}
3737

38-
# Some modules need to import things just so that sphinx can resolve symbols in
39-
# type annotations. Often, we do not want these imports (e.g. of PyOpenCL) when
40-
# in normal use (because they would introduce unintended side effects or hard
41-
# dependencies). This flag exists so that these imports only occur during doc
42-
# build. Since sphinx appears to resolve type hints lexically (as it should),
43-
# this needs to be cross-module (since, e.g. an inherited arraycontext
44-
# docstring can be read by sphinx when building meshmode, a dependent package),
45-
# this needs a setting of the same name across all packages involved, that's
46-
# why this name is as global-sounding as it is.
47-
import sys
48-
49-
50-
sys._BUILDING_SPHINX_DOCS = True
51-
5238
nitpicky = True
5339

5440
nitpick_ignore_regex = [
@@ -62,13 +48,13 @@
6248
["py:class", r"immutables\.(.+)"],
6349

6450
# Reference not found from "<unknown>"? I'm not even sure where to look.
65-
["py:class", r"Expression"],
51+
["py:class", r"ExpressionNode"],
52+
53+
# Type aliases
54+
["py:class", r"InameStr"],
55+
["py:class", r"ConcreteCallablesTable"],
56+
["py:class", r"LoopNestTree"],
57+
["py:class", r"LoopTree"],
58+
["py:class", r"ToLoopyTypeConvertible"],
59+
["py:class", r"ToStackMatchConvertible"],
6660
]
67-
68-
autodoc_type_aliases = {
69-
"ToLoopyTypeConvertible": "ToLoopyTypeConvertible",
70-
"ExpressionT": "ExpressionT",
71-
"InameStr": "InameStr",
72-
"ShapeType": "ShapeType",
73-
"StridesType": "StridesType",
74-
}

doc/ref_kernel.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ consist of arithmetic operations and calls to functions.
2525
If the outermost operation of the RHS expression is a function call,
2626
the RHS value may be a tuple, and multiple (still scalar) arrays appear
2727
as LHS values. (This is the only sense in which tuple types are supported.)
28-
Each statement is parametrized by zero or more loop variables ("inames").
28+
Each statement is parameterized by zero or more loop variables ("inames").
2929
A statement is executed once for each integer point defined by the domain
3030
forest for the iname tuple given for that statement
3131
(:attr:`loopy.InstructionBase.within_inames`). Each execution of a
@@ -656,8 +656,6 @@ Helper values
656656

657657
.. {{{
658658
659-
.. autoclass:: auto
660-
661659
.. autoclass:: UniqueName
662660

663661
.. autoclass:: Optional
@@ -693,11 +691,7 @@ The Kernel Object
693691
Do not create :class:`LoopKernel` objects directly. Instead, refer to
694692
:ref:`creating-kernels`.
695693

696-
.. autoclass:: LoopKernel
697-
698-
.. autoclass:: KernelState
699-
:members:
700-
:undoc-members:
694+
.. automodule:: loopy.kernel
701695

702696
Implementation Details: The Base Array
703697
--------------------------------------

doc/tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,15 +1681,15 @@ Each line of output will look roughly like::
16811681
data type accessed.
16821682

16831683
- lid_strides: A :class:`dict` of **{** :class:`int` **:**
1684-
:class:`pymbolic.primitives.Expression` or :class:`int` **}** that specifies
1684+
:data:`~pymbolic.typing.Expression` or :class:`int` **}** that specifies
16851685
local strides for each local id in the memory access index. Local ids not
16861686
found will not be present in ``lid_strides.keys()``. Uniform access (i.e.
16871687
work-items within a sub-group access the same item) is indicated by setting
16881688
``lid_strides[0]=0``, but may also occur when no local id 0 is found, in
16891689
which case the 0 key will not be present in lid_strides.
16901690

16911691
- gid_strides: A :class:`dict` of **{** :class:`int` **:**
1692-
:class:`pymbolic.primitives.Expression` or :class:`int` **}** that specifies
1692+
:data:`~pymbolic.typing.Expression` or :class:`int` **}** that specifies
16931693
global strides for each global id in the memory access index. Global ids not
16941694
found will not be present in ``gid_strides.keys()``.
16951695

examples/python/ispc-stream-harness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def transform(knl, vars, stream_dtype):
2626

2727
knl = lp.add_and_infer_dtypes(knl, dict.fromkeys(vars, stream_dtype))
2828

29-
knl = lp.set_argument_order(knl, vars + ["n"])
29+
knl = lp.set_argument_order(knl, [*vars, "n"])
3030

3131
return knl
3232

loopy/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from __future__ import annotations
2+
3+
14
__copyright__ = "Copyright (C) 2012 Andreas Kloeckner"
25

36
__license__ = """
@@ -478,7 +481,7 @@ def register_preamble_generators(kernel: LoopKernel, preamble_generators):
478481
"and would thus disrupt loopy's caches"
479482
% pgen)
480483

481-
new_pgens = (pgen,) + new_pgens
484+
new_pgens = (pgen, *new_pgens)
482485

483486
return kernel.copy(preamble_generators=new_pgens)
484487

@@ -496,7 +499,7 @@ def register_symbol_manglers(kernel, manglers):
496499
"and would disrupt loopy's caches"
497500
% m)
498501

499-
new_manglers = (m,) + new_manglers
502+
new_manglers = (m, *new_manglers)
500503

501504
return kernel.copy(symbol_manglers=new_manglers)
502505

0 commit comments

Comments
 (0)