Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tasmith4/loopy
  • ben_sepanski/loopy
  • arghdos/loopy
  • inducer/loopy
  • wence-/loopy
  • isuruf/loopy
  • fikl2/loopy
  • xywei/loopy
  • kaushikcfd/loopy
  • zweiner2/loopy
10 results
Show changes
Commits on Source (3603)
Showing with 812 additions and 239 deletions
#! /bin/bash
set -e
function install_example_prereqs()
{
# ipython_genutils for https://github.com/jupyter/nbconvert/issues/1725
# jinja < 3.1 for https://github.com/jupyter/nbconvert/issues/1736
with_echo pip install \
matplotlib ipykernel nbconvert ipython_genutils 'jinja2 < 3.1'
install_ispc
}
function run_examples()
{
PATTERN=$1
CMDLINE=$2
for i in $(find examples -name "$PATTERN" -print ); do
echo "-----------------------------------------------------------------------"
echo "RUNNING $i"
echo "-----------------------------------------------------------------------"
dn=$(dirname "$i")
bn=$(basename "$i")
(cd $dn; echo $CMDLINE "$bn"; $CMDLINE "$bn")
done
}
function run_py_examples()
{
run_examples "*.py" ${PY_EXE}
}
function run_ipynb_examples()
{
run_examples "*.ipynb" "${PY_EXE} -m nbconvert --to html --execute"
}
function run_floopy_examples()
{
run_examples "*.floopy" "${PY_EXE} -m loopy"
}
# https://editorconfig.org/
# https://github.com/editorconfig/editorconfig-vim
# https://github.com/editorconfig/editorconfig-emacs
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
[*.rst]
indent_size = 4
[*.cpp]
indent_size = 2
[*.hpp]
indent_size = 2
# There may be one in doc/
[Makefile]
indent_style = tab
# https://github.com/microsoft/vscode/issues/1679
[*.md]
trim_trailing_whitespace = false
version: 2
updates:
# Set update schedule for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# vim: sw=4
name: Gitlab mirror
on:
push:
branches:
- main
jobs:
autopush:
name: Automatic push to gitlab.tiker.net
if: startsWith(github.repository, 'inducer/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
mirror_github_to_gitlab
env:
GITLAB_AUTOPUSH_KEY: ${{ secrets.GITLAB_AUTOPUSH_KEY }}
# vim: sw=4
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '17 3 * * 0'
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: "Main Script"
run: |
pipx install ruff
ruff check
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
sed 's/python=3/python=3.7/' .test-conda-env-py3.yml > .test-conda-env.yml
USE_CONDA_BUILD=1
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
mypy:
name: Mypy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
EXTRA_INSTALL="mypy pytest types-colorama types-Pygments"
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
./run-mypy.sh
pytest:
name: Conda Pytest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
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:
name: Conda Pytest with Intel CL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
curl -L -O https://raw.githubusercontent.com/illinois-scicomp/machine-shop-maintenance/main/install-intel-icd.sh
sudo bash ./install-intel-icd.sh
CONDA_ENVIRONMENT=.test-conda-env-py3.yml
echo "- ocl-icd-system" >> "$CONDA_ENVIRONMENT"
sed -i "/pocl/ d" "$CONDA_ENVIRONMENT"
export PYOPENCL_TEST=intel
source /opt/enable-intel-cl.sh
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
test_py_project
pytest_no_arg_check:
name: Conda Pytest without arg check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
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
pytest_twice:
name: Conda Pytest Twice (for cache behavior)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
# This test makes sure that loopy can run with kernels loaded from disk cache.
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
( test_py_project )
# See https://github.com/inducer/loopy/pull/828 why this is disabled.
# export LOOPY_ABORT_ON_CACHE_MISS=1
( test_py_project )
examples:
name: Conda Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_conda_env
rewrite_pyopencl_test
. ./.ci/examples-funcs.sh
install_example_prereqs
run_py_examples
run_ipynb_examples
run_floopy_examples
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: "Main Script"
run: |
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_conda_env
build_docs
downstream_tests:
strategy:
matrix:
downstream_project: [arraycontext, meshmode, grudge, pytential, pytato]
fail-fast: false
name: Tests for downstream project ${{ matrix.downstream_project }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
env:
DOWNSTREAM_PROJECT: ${{ matrix.downstream_project }}
run: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
test_downstream "$DOWNSTREAM_PROJECT"
downstream_firedrake:
name: Tests for downstream project Firedrake
runs-on: ubuntu-latest
container:
image: 'firedrakeproject/firedrake'
steps:
- name: "Main script"
run: |
cd /home/firedrake
python3 -m venv --system-site-packages myvenv
export HOME="$(pwd)"
mkdir loopy
cd loopy
git init
git remote add origin "https://github.com/$GITHUB_REPOSITORY.git"
git fetch origin "$GITHUB_REF"
git checkout FETCH_HEAD
git submodule update --init
. /home/firedrake/myvenv/bin/activate
pip install --editable .
pip uninstall -y pytools
pip uninstall -y pymbolic
pip install "git+https://github.com/inducer/pytools.git#egg=pytools"
pip install "git+https://github.com/inducer/pymbolic.git#egg=pymbolic"
cd /home/firedrake/firedrake
# patch so exception messages get shown
curl -L https://gist.githubusercontent.com/inducer/17d7134ace215f0df1f3627eac4195c7/raw/ec5470a7d8587b6e1f336f3ef1d0ece5e26f236a/firedrake-debug-patch.diff | patch -p1
sed -i 's/@mpiexec/@mpiexec --oversubscribe/' Makefile
make check
validate_cff:
name: Validate CITATION.cff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: |
pip install cffconvert
cffconvert -i CITATION.cff --validate
# vim: sw=4
......@@ -19,5 +19,16 @@ htmlcov
.ipynb_checkpoints
lextab.py
yacctab.py
.pytest_cache/*
.cache
.env
virtualenv-[0-9]*[0-9]
*.so
.asv
# Files used by run-pylint.sh
.pylintrc.yml
.run-pylint.py
Python 2.7 AMD CPU:
Pytest POCL:
script:
- export PY_EXE=python2.7
- export PYOPENCL_TEST=amd:pu
- export EXTRA_INSTALL="numpy mako"
- 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/master/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:
- python2.7
- amd-cl-cpu
except:
- tags
Python 2.6 POCL:
script:
- export PY_EXE=python2.6
- export PYOPENCL_TEST=portable
- export EXTRA_INSTALL="numpy mako"
- export LOOPY_NO_CACHE=1
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
tags:
- python2.6
- python3
- pocl
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
Python 3.5 AMD CPU:
Pytest Nvidia Titan V:
script:
- export PY_EXE=python3.5
- export PYOPENCL_TEST=amd:pu
- export EXTRA_INSTALL="numpy mako"
- export NO_DOCTESTS=1
- export PYOPENCL_TEST=nvi:titan
- export EXTRA_INSTALL="pybind11 numpy mako"
- export LOOPY_NO_CACHE=1
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- source /opt/enable-intel-cl.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.5
- amd-cl-cpu
- python3
- nvidia-titan-v
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
Python 2.7 POCL:
Pytest POCL without arg check:
script:
- export PY_EXE=python2.7
- export PYOPENCL_TEST=portable
- export EXTRA_INSTALL="numpy mako"
- 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/master/build-and-test-py-project.sh
- export _LOOPY_SKIP_ARG_CHECKS=1
- 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:
- python2.7
- python3
- pocl
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
Python 2.7 with legacy PyOpenCL:
Pytest Intel:
script:
- export PY_EXE=python2.7
- export PYOPENCL_TEST=portable
- export EXTRA_INSTALL="numpy mako"
- export REQUIREMENTS_TXT="requirements-old-pyopencl.txt"
- export PYOPENCL_TEST=intel
- export EXTRA_INSTALL="pybind11 numpy mako"
- export LOOPY_NO_CACHE=1
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- export LOOPY_INTEL_CL_OK_FOR_TEST_REF=1
- source /opt/enable-intel-cl.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:
- python2.7
- pocl
- python3
- intel-cl-cpu
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
Python 3.6 POCL:
script:
- export PY_EXE=python3.6
- export PYOPENCL_TEST=portable
- export EXTRA_INSTALL="numpy mako"
- export LOOPY_NO_CACHE=1
- export NO_DOCTESTS=1
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
- ". ./build-and-test-py-project.sh"
Pytest POCL Twice With Cache:
script: |
export PYOPENCL_TEST=portable:pthread
export EXTRA_INSTALL="pybind11 numpy mako"
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 )
( test_py_project )
tags:
- python3.6
- python3
- pocl
except:
- tags
artifacts:
reports:
junit: test/pytest.xml
# PyPy AMD CPU:
# PyPy POCL:
# script:
# - export PY_EXE=pypy
# - export PYOPENCL_TEST="amd:pu"
# - export EXTRA_INSTALL="numpy mako"
# - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh
# - export PYOPENCL_TEST=portable:pthread
# - export EXTRA_INSTALL="pybind11 numpy mako"
# - 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
# - amd-cl-cpu
# - pocl
# except:
# - tags
CentOS binary:
Pytest POCL Examples:
script: |
export PYOPENCL_TEST=portable:pthread
export EXTRA_INSTALL="pybind11 numpy mako"
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_venv
rewrite_pyopencl_test
. ./.ci/examples-funcs.sh
install_example_prereqs
run_py_examples
run_ipynb_examples
run_floopy_examples
tags:
- python3
- pocl
- large-node
# For examples/python/ispc-stream-harness.py
- avx2
except:
- tags
Pylint:
script:
- (cd build-helpers; ./make-linux-build-docker.sh --nodate)
- (cd ./build-helpers; ./loopy-centos6 ../examples/fortran/sparse.floopy)
artifacts:
expire_in: 4 weeks
paths:
- build-helpers/loopy-centos6
# 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 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:
- docker
only:
- master
- python3
except:
- tags
Documentation:
script:
- EXTRA_INSTALL="numpy"
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-docs.sh
- ". ./build-docs.sh"
script: |
EXTRA_INSTALL="pybind11 numpy"
curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_venv
build_docs
build_asv_html
maybe_upload_docs
tags:
- python3.5
only:
- master
- python3
Flake8:
Ruff:
script:
- curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh
- ". ./prepare-and-run-flake8.sh loopy test"
- pipx install ruff
- ruff check
tags:
- docker-runner
except:
- tags
Mypy:
script: |
EXTRA_INSTALL="mypy pybind11 numpy types-colorama types-Pygments"
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
build_py_project_in_venv
./run-mypy.sh
tags:
- python3.5
- python3
except:
- tags
Downstream:
parallel:
matrix:
- DOWNSTREAM_PROJECT: [arraycontext, meshmode, grudge, pytential, pytato]
tags:
- large-node
- "docker-runner"
script: |
curl -L -O https://tiker.net/ci-support-v0
. ./ci-support-v0
test_downstream "$DOWNSTREAM_PROJECT"
[submodule "loopy/target/c/compyte"]
path = loopy/target/c/compyte
url = https://github.com/inducer/compyte
url = https://github.com/inducer/compyte.git
- arg: extension-pkg-whitelist
val: islpy
- arg: ignore
val:
- compyte
- arg: ignored-modules
val:
- IPython
- pycuda
- maptlotlib
- maptlotlib.pyplot
- arg: init-hook
val: import sys; sys.setrecursionlimit(5000)
- arg: disable
val:
- E1102
name: test-conda-env
channels:
- conda-forge
- nodefaults
dependencies:
- python=3
- git
- numpy
- pocl
- mako
- pyopencl
- islpy
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
# major contributors
- family-names: "Kloeckner"
given-names: "Andreas"
orcid: "https://orcid.org/0000-0003-1228-519X"
- family-names: Kulkarni
given-names: Kaushik
email: kaushikcfd@gmail.com
- family-names: Kempf
given-names: Dominic
email: dominic.r.kempf@gmail.com
- family-names: Wala
given-names: Matt
email: wala1@illinois.edu
- family-names: Curtis
given-names: Nick
email: arghdos@gmail.com
- family-names: Stevens
given-names: James
email: jdsteve2@illinois.edu
- family-names: Fernando
given-names: Isuru
email: isuruf@gmail.com
# smaller fixes
- family-names: Mitchell
given-names: Lawrence
email: lawrence@wence.uk
- family-names: Alvey-Blanco
given-names: Addison J.
email: aalveyblanco@gmail.com
- family-names: Fikl
given-names: Alexandru
email: alexfikl@gmail.com
- family-names: Malone
given-names: Chris
email: chris.m.malone@gmail.com
- family-names: Ward
given-names: Connor
email: c.ward20@imperial.ac.uk
- family-names: Wilcox
given-names: Lucas C.
email: lucas@swirlee.com
- family-names: Koch
given-names: Marcel
email: marcel.koch@uni-muenster.de
- family-names: Woodman
given-names: Marmaduke
email: marmaduke.woodman@univ-amu.fr
- family-names: Smith
given-names: Matthew
email: mjsmith6@illinois.edu
- family-names: Diener
given-names: Matthias
email: mdiener@illinois.edu
- family-names: Christensen
given-names: Nicholas
email: njchris2@illinois.edu
- family-names: Nykto
given-names: Nicolas
email: nnytko2@illinois.edu
- family-names: Kirby
given-names: Robert C.
email: Robert_Kirby@baylor.edu
- family-names: Hegmann
given-names: Sebastian
email: shegmann@nina.iwr.uni-heidelberg.de
- family-names: Vorderwuelbecke
given-names: Sophia
email: sv2518@ic.ac.uk
- family-names: Ratnayaka
given-names: Thilina
email: thilinarmtb@gmail.com
- family-names: Gibson
given-names: Thomas
email: gibsonthomas1120@hotmail.com
- family-names: Sun
given-names: Tianjiao
email: tj-sun@tianjiaos-air.home
- family-names: Smith
given-names: Timothy A.
email: tasmith4@illinois.edu
- family-names: Warburton
given-names: Tim
email: timwar@caam.rice.edu
- family-names: Wei
given-names: Xiaoyu
email: wxy0516@gmail.com
- family-names: Weiner
given-names: Zach
email: zachjweiner@gmail.com
title: "Loopy"
version: 2024.1
date-released: 2024-02-16
url: "https://github.com/inducer/loopy"
doi: 10.5281/zenodo.10672275
license: MIT
MIT License
Copyright (c) 2018 Andreas Klöckner and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
include test/*.py
include test/*.f90
recursive-include examples *.py *.cl *.floopy *.sh *.ipynb *.cpp
recursive-include contrib *.vim
include build-helpers/*.sh
include build-helpers/*.spec
include doc/*.rst
include doc/Makefile
include doc/*.py
include doc/images/*.png
include doc/_static/*.css
include doc/_templates/*.html
include doc/images/*.svg
include doc/images/*.png
include configure.py
include Makefile.in
include README.rst
include requirements*.txt
......@@ -7,7 +7,7 @@ Documentation Notes
Things to consider
^^^^^^^^^^^^^^^^^^
- Depedencies are pointwise for shared loop dimensions
- Dependencies are pointwise for shared loop dimensions
and global over non-shared ones (between dependent and ancestor)
- multiple insns could fight over which iname gets local axis 0
......
Loopy: Transformation-Based Generation of High-Performance CPU/GPU Code
=======================================================================
.. image:: https://gitlab.tiker.net/inducer/loopy/badges/main/pipeline.svg
:alt: Gitlab Build Status
:target: https://gitlab.tiker.net/inducer/loopy/commits/main
.. image:: https://github.com/inducer/loopy/actions/workflows/ci.yml/badge.svg
:alt: Github Build Status
:target: https://github.com/inducer/loopy/actions/workflows/ci.yml
.. image:: https://badge.fury.io/py/loopy.svg
:alt: Python Package Index Release Page
:target: https://pypi.org/project/loopy/
.. image:: https://zenodo.org/badge/20281732.svg
:alt: Zenodo DOI for latest release
:target: https://zenodo.org/doi/10.5281/zenodo.10672274
Loopy lets you easily generate the tedious, complicated code that is necessary
to get good performance out of GPUs and multi-core CPUs.
----
Places on the web related to Loopy:
* `Python package index <http://pypi.python.org/pypi/loo.py>`_ (download releases) Note the extra '.' in the PyPI identifier!
.. image:: https://badge.fury.io/py/loo.py.png
:target: http://pypi.python.org/pypi/loo.py
* `Documentation <http://documen.tician.de/loopy>`_ (read how things work)
* `Github <http://github.com/inducer/loopy>`_ (get latest source code, file bugs)
* `Wiki <http://wiki.tiker.net/Loopy>`_ (read installation tips, get examples, read FAQ)
* `Homepage <http://mathema.tician.de/software/loopy>`_
----
Loopy's core idea is that a computation should be described simply and then
*transformed* into a version that gets high performance. This transformation
takes place under user control, from within Python.
......@@ -25,11 +24,11 @@ It can capture the following types of optimizations:
* Vector and multi-core parallelism in the OpenCL/CUDA model
* Data layout transformations (structure of arrays to array of structures)
* Loopy Unrolling
* Loop unrolling
* Loop tiling with efficient handling of boundary cases
* Prefetching/copy optimizations
* Instruction level parallelism
* and many more
* and many more!
Loopy targets array-type computations, such as the following:
......@@ -37,17 +36,26 @@ Loopy targets array-type computations, such as the following:
* convolutions,
* n-body interactions,
* PDE solvers, such as finite element, finite difference, and
Fast-Multipole-type computations
Fast-Multipole-type computations.
It is not (and does not want to be) a general-purpose programming language.
Loopy is licensed under the liberal `MIT license
<http://en.wikipedia.org/wiki/MIT_License>`_ and free for commercial, academic,
<https://en.wikipedia.org/wiki/MIT_License>`__ and free for commercial, academic,
and private use. All of Loopy's dependencies can be automatically installed from
the package index after using::
pip install loo.py
pip install loopy
In addition, Loopy is compatible with and enhances
`pyopencl <http://mathema.tician.de/software/pyopencl>`_.
`pyopencl <https://mathema.tician.de/software/pyopencl>`__.
---
Places on the web related to Loopy:
* `Python Package Index <https://pypi.org/project/loopy>`__ (download releases)
* `Documentation <https://documen.tician.de/loopy>`__ (read how things work)
* `Github <https://github.com/inducer/loopy>`__ (get latest source code, file bugs)
* `Homepage <https://mathema.tician.de/software/loopy>`__
* `Benchmarks <https://documen.tician.de/loopy/benchmarks>`__
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,
// The name of the project being benchmarked
"project": "loopy",
// The project's homepage
"project_url": "https://documen.tician.de/loopy",
// The URL or local path of the source code repository for the
// project being benchmarked
"repo": ".",
// The Python project's subdirectory in your repo. If missing or
// the empty string, the project is assumed to be located at the root
// of the repository.
// "repo_subdir": "",
// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "default" (for mercurial).
"branches": ["main"], // for git
// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
// "dvcs": "git",
// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "conda",
// timeout in seconds for installing any dependencies in environment
// defaults to 10 min
//"install_timeout": 600,
// the base URL to show a commit for the project.
"show_commit_url": "http://github.com/inducer/loopy/commit/",
// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["2.7", "3.6"],
// The list of conda channel names to be searched for benchmark
// dependency packages in the specified order
"conda_channels": ["conda-forge", "defaults"],
// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list or empty string indicates to just test against the default
// (latest) version. null indicates that the package is to not be
// installed. If the package to be tested is only available from
// PyPi, and the 'environment_type' is conda, then you can preface
// the package name by 'pip+', and the package will be installed via
// pip (with all the conda available packages installed first,
// followed by the pip installed packages).
//
// "matrix": {
// "numpy": ["1.6", "1.7"],
// "six": ["", null], // test with and without six installed
// "pip+emcee": [""], // emcee is only available for install with pip.
// },
"matrix": {
"numpy" : [""],
"pyopencl" : [""],
"islpy" : [""],
"pocl" : [""],
"pip+git+https://github.com/inducer/pymbolic#egg=pymbolic": [""],
"pip+git+https://github.com/inducer/boxtree#egg=boxtree": [""],
"pip+git+https://github.com/inducer/loopy#egg=loopy": [""],
"pip+git+https://github.com/inducer/sumpy#egg=sumpy": [""],
},
// Combinations of libraries/python versions can be excluded/included
// from the set to test. Each entry is a dictionary containing additional
// key-value pairs to include/exclude.
//
// An exclude entry excludes entries where all values match. The
// values are regexps that should match the whole string.
//
// An include entry adds an environment. Only the packages listed
// are installed. The 'python' key is required. The exclude rules
// do not apply to includes.
//
// In addition to package names, the following keys are available:
//
// - python
// Python version, as in the *pythons* variable above.
// - environment_type
// Environment type, as above.
// - sys_platform
// Platform, as in sys.platform. Possible values for the common
// cases: 'linux2', 'win32', 'cygwin', 'darwin'.
//
// "exclude": [
// {"python": "3.2", "sys_platform": "win32"}, // skip py3.2 on windows
// {"environment_type": "conda", "six": null}, // don't run without six on conda
// ],
//
// "include": [
// // additional env for python2.7
// {"python": "2.7", "numpy": "1.8"},
// // additional env if run on windows+conda
// {"platform": "win32", "environment_type": "conda", "python": "2.7", "libpython": ""},
// ],
// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
// "benchmark_dir": "benchmarks",
// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": ".asv/env",
// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": ".asv/results",
// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": ".asv/html",
// The number of characters to retain in the commit hashes.
// "hash_length": 8,
// `asv` will cache wheels of the recent builds in each
// environment, making them faster to install next time. This is
// number of builds to keep, per environment.
// "wheel_cache_size": 0
// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
// the commit (exclusive) after which to start looking for
// regressions. The default is to start from the first commit
// with results. If the commit is `null`, regression detection is
// skipped for the matching benchmark.
//
// "regressions_first_commits": {
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// }
// The thresholds for relative change in results, after which `asv
// publish` starts reporting regressions. Dictionary of the same
// form as in ``regressions_first_commits``, with values
// indicating the thresholds. If multiple entries match, the
// maximum is taken. If no entry matches, the default is 5%.
//
// "regressions_thresholds": {
// "some_benchmark": 0.01, // Threshold of 1%
// "another_benchmark": 0.5, // Threshold of 50%
// }
}
loopy-*-20[0-9][0-9]*
# -*- mode: python -*-
from os.path import basename, dirname, join
from glob import glob
single_file = True
# This makes the executable spew debug info.
debug = False
from os.path import expanduser
import packaging # pip install packaging to add
a = Analysis(['../bin/loopy'],
pathex=[expanduser('~/src/loopy')],
hiddenimports=[
"appdirs",
"packaging.markers",
"packaging.specifiers",
"packaging.version",
],
hookspath=None,
runtime_hooks=None,
excludes=["hedge", "meshpy", "pyopencl", "PIL"]
)
import ply.lex
import ply.yacc
a.datas += [
(join("py-src", "ply", "lex", basename(fn)), fn, "DATA")
for fn in glob(join(dirname(ply.lex.__file__), "*.py"))
] + [
(join("py-src", "ply", "yacc", basename(fn)), fn, "DATA")
for fn in glob(join(dirname(ply.yacc.__file__), "*.py"))
]
pyz = PYZ(a.pure)
if single_file:
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='loopy',
debug=debug,
strip=None,
upx=True,
console=True)
else:
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='loopy',
debug=debug,
strip=None,
upx=True,
console=True)
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='loopy')
#! /bin/bash
set -e
set -x
VENV_VERSION="virtualenv-1.9.1"
rm -Rf "$VENV_VERSION"
curl -k https://pypi.python.org/packages/source/v/virtualenv/$VENV_VERSION.tar.gz | tar xfz -
$VENV_VERSION/virtualenv.py --system-site-packages --no-setuptools .env
source .env/bin/activate
curl -k https://ssl.tiker.net/software/ez_setup.py | python -
curl -k https://gitlab.tiker.net/inducer/pip/raw/7.0.3/contrib/get-pip.py | python -
pip install packaging
PYTHON_VER=$(python -c 'import sys; print(".".join(str(s) for s in sys.version_info[:2]))')
pip install git+https://github.com/pyinstaller/pyinstaller.git@413c37bec126c0bd26084813593f65128966b4b7
git clone --recursive git://github.com/inducer/loopy
cd loopy
grep -v pyopencl requirements.txt > myreq.txt
pip install -r myreq.txt
python setup.py install
chown -R user /tmp/build
su user -p -c "cd /tmp/build && source .env/bin/activate && cd loopy && ./build-helpers/run-pyinstaller.sh"
#! /bin/bash
set -e
set -x
mkdir /tmp/build
cd /tmp/build
useradd -d /home/user -m -s /bin/bash user
yum install -y centos-release-scl
yum install -y git python27 python27-python-devel python27-numpy tar gcc gcc-c++ mercurial libffi-devel
scl enable python27 /mnt/make-linux-build-docker-inner-part-2.sh