Skip to content

Commit

Permalink
Merge pull request #18 from firedrakeproject/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
dham authored Feb 27, 2022
2 parents d8fcc85 + bbcb57f commit c95c740
Show file tree
Hide file tree
Showing 24 changed files with 2,668 additions and 2,061 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: '3.6'
- name: "Main Script"
run: |
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-flake8.sh
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-flake8.sh
. ./prepare-and-run-flake8.sh "$(basename $GITHUB_REPOSITORY)" ./test examples
pylint:
Expand All @@ -32,7 +32,7 @@ jobs:
run: |
sed 's/python=3/python=3.7/' .test-conda-env-py3.yml > .test-conda-env.yml
USE_CONDA_BUILD=1
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-pylint.sh
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-pylint.sh
. ./prepare-and-run-pylint.sh "$(basename $GITHUB_REPOSITORY)" test/test_*.py
pytest:
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- name: "Main Script"
run: |
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh
. ./build-and-test-py-project-within-miniconda.sh
pytest_intel:
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v2
- name: "Main Script"
run: |
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project-within-miniconda.sh
export _LOOPY_SKIP_ARG_CHECKS=1
. ./build-and-test-py-project-within-miniconda.sh
Expand All @@ -82,7 +82,7 @@ jobs:
- uses: actions/checkout@v2
- name: "Main Script"
run: |
curl -L -O -k https://tiker.net/ci-support-v0
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
( test_py_project )
Expand All @@ -96,12 +96,11 @@ jobs:
- name: "Main Script"
run: |
EXTRA_INSTALL="matplotlib ipykernel nbconvert"
curl -L -O -k https://tiker.net/ci-support-v0
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
curl -L "https://ci.appveyor.com/api/projects/ispc/ispc/artifacts/build%2Fispc-trunk-linux.tar.gz?job=Environment%3A%20APPVEYOR_BUILD_WORKER_IMAGE%3DUbuntu1604%2C%20LLVM_VERSION%3Dlatest" | tar xfz -
export PATH="$(pwd)/ispc-trunk-linux/bin:$PATH"
install_ispc
export PYOPENCL_TEST=portable:pthread
Expand All @@ -122,7 +121,7 @@ jobs:
- name: "Main Script"
run: |
PROJECT=loopy
curl -L -O -k https://tiker.net/ci-support-v0
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_conda_env
build_docs
Expand Down Expand Up @@ -198,7 +197,7 @@ jobs:
run: |
# helps with tmate debugging
sudo chmod a+rwX -R $(whoami) /__w/_temp || true
# - uses: mxschmitt/action-tmate@v3

# vim: sw=4
28 changes: 14 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pytest POCL:
- export PYOPENCL_TEST=portable:pthread
- export EXTRA_INSTALL="pybind11 numpy mako"
- export LOOPY_NO_CACHE=1
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
tags:
- python3
Expand All @@ -26,7 +26,7 @@ Pytest Nvidia Titan V:
- export EXTRA_INSTALL="pybind11 numpy mako"
- export LOOPY_NO_CACHE=1
- source /opt/enable-intel-cl.sh
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
tags:
- python3
Expand All @@ -44,7 +44,7 @@ Pytest POCL without arg check:
- export EXTRA_INSTALL="pybind11 numpy mako"
- export LOOPY_NO_CACHE=1
- export _LOOPY_SKIP_ARG_CHECKS=1
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
tags:
- python3
Expand All @@ -63,7 +63,7 @@ Pytest Intel:
- export LOOPY_NO_CACHE=1
- export LOOPY_INTEL_CL_OK_FOR_TEST_REF=1
- source /opt/enable-intel-cl.sh
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
tags:
- python3
Expand All @@ -80,7 +80,7 @@ Pytest POCL Twice With Cache:
script: |
export PYOPENCL_TEST=portable:pthread
export EXTRA_INSTALL="pybind11 numpy mako"
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh
curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh
. ./ci-support.sh
build_py_project_in_venv
( test_py_project )
Expand All @@ -100,7 +100,7 @@ Pytest POCL Twice With Cache:
# - export PY_EXE=pypy
# - export PYOPENCL_TEST=portable:pthread
# - export EXTRA_INSTALL="pybind11 numpy mako"
# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
# - curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-test-py-project.sh
# - ". ./build-and-test-py-project.sh"
# tags:
# - pypy
Expand All @@ -114,12 +114,12 @@ Pytest POCL Examples:
export PYOPENCL_TEST=portable:pthread
export EXTRA_INSTALL="pybind11 numpy mako pyvisfile matplotlib ipykernel nbconvert"
curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh
. ./ci-support.sh
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_venv
curl -L "https://ci.appveyor.com/api/projects/ispc/ispc/artifacts/build%2Fispc-trunk-linux.tar.gz?job=Environment%3A%20APPVEYOR_BUILD_WORKER_IMAGE%3DUbuntu1604%2C%20LLVM_VERSION%3Dlatest" | tar xfz -
export PATH="$(pwd)/ispc-trunk-linux/bin:$PATH"
install_ispc
. ./build-py-project-and-run-examples.sh
run_py_examples
Expand All @@ -140,7 +140,7 @@ Pylint:
# Needed to avoid name shadowing issues when running from source directory.
- PROJECT_INSTALL_FLAGS="--editable"
- EXTRA_INSTALL="pybind11 numpy mako matplotlib ipykernel ply fparser"
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-pylint.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-pylint.sh
- . ./prepare-and-run-pylint.sh "$CI_PROJECT_NAME" test/test_*.py
tags:
- python3
Expand All @@ -152,15 +152,15 @@ Documentation:
script:
- PROJECT=loopy
- EXTRA_INSTALL="pybind11 numpy"
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-docs.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-docs.sh
- ". ./build-docs.sh"
tags:
- python3

Flake8:
stage: test
script:
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-flake8.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/prepare-and-run-flake8.sh
- . ./prepare-and-run-flake8.sh "$CI_PROJECT_NAME" test examples
tags:
- python3
Expand All @@ -175,7 +175,7 @@ Benchmarks:
- PYOPENCL_TEST=portable:pthread
- export LOOPY_NO_CACHE=1
- export ASV_FACTOR=1.5
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-benchmark-py-project.sh
- curl -L -O https://gitlab.tiker.net/inducer/ci-support/raw/main/build-and-benchmark-py-project.sh
- ". ./build-and-benchmark-py-project.sh"
tags:
- linux
Expand Down
3 changes: 2 additions & 1 deletion examples/python/ispc-stream-harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def gen_code(knl):


def main():
with open("tasksys.cpp") as ts_file:
this_dir = os.path.dirname(__file__)
with open(os.path.join(this_dir, "tasksys.cpp")) as ts_file:
tasksys_source = ts_file.read()

def make_knl(name, insn, vars):
Expand Down
12 changes: 7 additions & 5 deletions loopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
from loopy.transform.iname import (
set_loop_priority, prioritize_loops, untag_inames,
split_iname, chunk_iname, join_inames, tag_inames, duplicate_inames,
rename_iname, remove_unused_inames,
rename_iname, rename_inames, remove_unused_inames,
split_reduction_inward, split_reduction_outward,
affine_map_inames, find_unused_axis_tag,
make_reduction_inames_unique,
Expand Down Expand Up @@ -122,10 +122,12 @@
merge, inline_callable_kernel, rename_callable)
from loopy.transform.pack_and_unpack_args import pack_and_unpack_args_for_call

from loopy.transform.realize_reduction import realize_reduction

# }}}

from loopy.type_inference import infer_unknown_types
from loopy.preprocess import (preprocess_kernel, realize_reduction,
from loopy.preprocess import (preprocess_kernel,
preprocess_program, infer_arg_descr)
from loopy.schedule import (
generate_loop_schedules, get_one_scheduled_kernel,
Expand Down Expand Up @@ -154,7 +156,7 @@
from loopy.target.ispc import ISPCTarget
from loopy.target.numba import NumbaTarget, NumbaCudaTarget

from loopy.tools import Optional, t_unit_to_python
from loopy.tools import Optional, t_unit_to_python, memoize_on_disk


__all__ = [
Expand Down Expand Up @@ -198,7 +200,7 @@
"set_loop_priority", "prioritize_loops", "untag_inames",
"split_iname", "chunk_iname", "join_inames", "tag_inames",
"duplicate_inames",
"rename_iname", "remove_unused_inames",
"rename_iname", "rename_inames", "remove_unused_inames",
"split_reduction_inward", "split_reduction_outward",
"affine_map_inames", "find_unused_axis_tag",
"make_reduction_inames_unique",
Expand Down Expand Up @@ -299,7 +301,7 @@
"NumbaTarget", "NumbaCudaTarget",
"ASTBuilderBase",

"Optional",
"Optional", "memoize_on_disk",

# {{{ from this file

Expand Down
3 changes: 1 addition & 2 deletions loopy/isl_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ def is_nonnegative(expr, over_set):
space = over_set.get_space()
from loopy.symbolic import aff_from_expr
try:
with isl.SuppressedWarnings(space.get_ctx()):
aff = aff_from_expr(space, -expr-1)
aff = aff_from_expr(space, -expr-1)
except Exception:
return None
expr_neg_set = isl.BasicSet.universe(space).add_constraint(
Expand Down
2 changes: 0 additions & 2 deletions loopy/kernel/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
from warnings import warn

__doc__ = """
.. currentmodule:: loopy.kernel.data
.. autofunction:: filter_iname_tags_by_type
.. autoclass:: InameImplementationTag
Expand Down
3 changes: 2 additions & 1 deletion loopy/kernel/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,8 @@ def make_assignment(assignees, expression, temp_var_types=None, **kwargs):
from loopy.symbolic import Reduction
if not isinstance(expression, (Call, Reduction)):
raise LoopyError("right-hand side in multiple assignment must be "
"function call or reduction, got: '%s'" % expression)
"function call or reduction, got: "
f"'{type(expression).__name__}'")

if not is_array_call(assignees, expression):
return CallInstruction(
Expand Down
6 changes: 2 additions & 4 deletions loopy/kernel/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,7 @@ def assign_axis(recursion_axis, iname, axis=None):
If *axis* is None, find a suitable axis automatically.
"""
try:
with isl.SuppressedWarnings(kernel.isl_context):
desired_length = kernel.get_constant_iname_length(iname)
desired_length = kernel.get_constant_iname_length(iname)
except isl.Error:
# Likely unbounded, automatic assignment is not
# going to happen for this iname.
Expand Down Expand Up @@ -947,8 +946,7 @@ def assign_axis(recursion_axis, iname, axis=None):

def get_iname_length(iname):
try:
with isl.SuppressedWarnings(kernel.isl_context):
return kernel.get_constant_iname_length(iname)
return kernel.get_constant_iname_length(iname)
except isl.Error:
return -1
# assign longest auto axis inames first
Expand Down
2 changes: 1 addition & 1 deletion loopy/library/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def neutral_element(self, scalar_dtype, index_dtype, callables_table,
index_dtype.numpy_dtype.type(-1)), callables_table

def __str__(self):
return self.which
return "arg" + self.which

def __hash__(self):
return hash(type(self))
Expand Down
Loading

0 comments on commit c95c740

Please sign in to comment.