Skip to content

Commit b1982b8

Browse files
authored
Merge branch 'main' into c_vecextensions_target
2 parents 5b0f9c2 + dd1ad18 commit b1982b8

26 files changed

+262
-80
lines changed
File renamed without changes.

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,18 @@ jobs:
9595
- uses: actions/checkout@v2
9696
- name: "Main Script"
9797
run: |
98-
EXTRA_INSTALL="matplotlib ipykernel nbconvert"
9998
curl -L -O https://tiker.net/ci-support-v0
10099
. ./ci-support-v0
101100
build_py_project_in_conda_env
102101
102+
# ipython_genutils for https://github.com/jupyter/nbconvert/issues/1725
103+
with_echo pip install matplotlib ipykernel nbconvert ipython_genutils
104+
103105
install_ispc
104106
105107
export PYOPENCL_TEST=portable:pthread
106108
107-
. ./build-py-project-and-run-examples.sh
109+
. ./.ci/examples-funcs.sh
108110
run_py_examples
109111
run_ipynb_examples
110112
run_floopy_examples

.gitlab-ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,19 @@ Pytest POCL Examples:
112112
stage: test
113113
script: |
114114
export PYOPENCL_TEST=portable:pthread
115-
export EXTRA_INSTALL="pybind11 numpy mako pyvisfile matplotlib ipykernel nbconvert"
115+
export EXTRA_INSTALL="pybind11 numpy mako"
116116
117117
curl -L -O https://tiker.net/ci-support-v0
118118
. ./ci-support-v0
119119
120120
build_py_project_in_venv
121121
122+
# ipython_genutils for https://github.com/jupyter/nbconvert/issues/1725
123+
pip install matplotlib ipykernel nbconvert ipython_genutils
124+
122125
install_ispc
123126
124-
. ./build-py-project-and-run-examples.sh
127+
. ./.ci/examples-funcs.sh
125128
run_py_examples
126129
run_ipynb_examples
127130
run_floopy_examples

.pylintrc-local.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
- arg: extension-pkg-whitelist
22
val: islpy
3+
34
- arg: ignore
4-
val: compyte
5+
val:
6+
- compyte
7+
8+
- arg: ignored-modules
9+
val:
10+
- IPython
11+
- pycuda
12+
- maptlotlib
13+
- maptlotlib.pyplot
14+
515
- arg: init-hook
616
val: sys.setrecursionlimit(5000)

.test-conda-env-py3.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,3 @@ dependencies:
1111
- mako
1212
- pyopencl
1313
- islpy
14-
15-
# Only needed to make pylint succeed
16-
- matplotlib-base
17-
- ipykernel
18-
- ply

doc/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ Consider this example:
560560
#define lid(N) ((int) get_local_id(N))
561561
...
562562
for (int i_outer = 0; i_outer <= -1 + (15 + n) / 16; ++i_outer)
563-
for (int i_inner = 0; i_inner <= (-16 + n + -16 * i_outer >= 0 ? 15 : -1 + n + -16 * i_outer); ++i_inner)
563+
for (int i_inner = 0; i_inner <= (-17 + n + -16 * i_outer >= 0 ? 15 : -1 + n + -16 * i_outer); ++i_inner)
564564
a[16 * i_outer + i_inner] = 0.0f;
565565
...
566566

loopy/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ def _are_sub_array_refs_equivalent(sar1, sar2, caller):
14531453

14541454
from loopy.symbolic import SubstitutionMapper
14551455
from pymbolic.mapper.substitutor import make_subst_func
1456-
from loopy.isl_helpers import simplify_via_aff
1456+
from loopy.symbolic import simplify_via_aff
14571457
subst_func = make_subst_func({iname1.name: iname2
14581458
for iname1, iname2 in zip(sar1.swept_inames,
14591459
sar2.swept_inames)

loopy/isl_helpers.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""isl helpers"""
22

3-
43
__copyright__ = "Copyright (C) 2012 Andreas Kloeckner"
54

65
__license__ = """
@@ -28,6 +27,7 @@
2827

2928
import islpy as isl
3029
from islpy import dim_type
30+
from warnings import warn
3131

3232

3333
def pw_aff_to_aff(pw_aff):
@@ -448,19 +448,6 @@ def add_in_dims(aff):
448448
# }}}
449449

450450

451-
def simplify_via_aff(expr):
452-
from loopy.symbolic import aff_to_expr, guarded_aff_from_expr, get_dependencies
453-
from loopy.diagnostic import ExpressionToAffineConversionError
454-
455-
deps = sorted(get_dependencies(expr))
456-
try:
457-
return aff_to_expr(guarded_aff_from_expr(
458-
isl.Space.create_from_names(isl.DEFAULT_CONTEXT, list(deps)),
459-
expr))
460-
except ExpressionToAffineConversionError:
461-
return expr
462-
463-
464451
def project_out(set, inames):
465452
for iname in inames:
466453
var_dict = set.get_var_dict()
@@ -849,4 +836,11 @@ def find_and_rename_dim(isl_obj, dt, old_name, new_name):
849836
# }}}
850837

851838

839+
def simplify_via_aff(expr):
840+
warn("simplify_via_aff has moved to loopy.symbolic. "
841+
"Importing it from loopy.isl_helpers will stop working in July 2022.",
842+
DeprecationWarning, stacklevel=2)
843+
from loopy.symbolic import simplify_via_aff
844+
return simplify_via_aff(expr)
845+
852846
# vim: foldmethod=marker

loopy/library/reduction.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,15 @@ def get_le_neutral(dtype):
188188
elif dtype.numpy_dtype.itemsize == 8:
189189
# 64 bit integer
190190
return var("LONG_MAX")
191-
else:
192-
raise NotImplementedError("less")
191+
elif dtype.numpy_dtype.kind == "u":
192+
if dtype.numpy_dtype.itemsize == 4:
193+
# 32 bit integer
194+
return var("UINT_MAX")
195+
elif dtype.numpy_dtype.itemsize == 8:
196+
# 64 bit integer
197+
return var("ULONG_MAX")
198+
199+
raise NotImplementedError(f"neutral element for <= and {dtype}")
193200

194201

195202
def get_ge_neutral(dtype):
@@ -211,8 +218,10 @@ def get_ge_neutral(dtype):
211218
elif dtype.numpy_dtype.itemsize == 8:
212219
# 64 bit integer
213220
return var("LONG_MIN")
214-
else:
215-
raise NotImplementedError("less")
221+
elif dtype.numpy_dtype.kind == "u":
222+
return 0
223+
224+
raise NotImplementedError(f"neutral element for >= and {dtype}")
216225

217226

218227
class MaxReductionOperation(ScalarReductionOperation):

loopy/match.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ def __init__(self, tag: pytools.tag.Tag):
228228
def __call__(self, kernel, matchable):
229229
return self.tag in matchable.tags
230230

231+
def update_persistent_hash(self, key_hash, key_builder):
232+
key_builder.rec(key_hash, type(self).__name__)
233+
key_builder.rec(key_hash, self.tag)
234+
231235

232236
class GlobMatchExpressionBase(MatchExpressionBase):
233237
def __init__(self, glob):

0 commit comments

Comments
 (0)