Skip to content

Commit

Permalink
Merge pull request #336 from prabhuramachandran/workaround-pyopencl-i…
Browse files Browse the repository at this point in the history
…ssue

Improve build config, work around issues.
  • Loading branch information
prabhuramachandran committed Feb 15, 2022
2 parents ab53503 + f1762f4 commit aeadf6a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Tests

on: pull_request
on:
pull_request:
schedule:
# Run test at 0400 UTC on Saturday.
- cron: '0 4 * * 6'


jobs:
tests:
Expand All @@ -25,13 +30,15 @@ jobs:
- name: Install dependencies on Linux/MacOS
run: |
conda info
conda install -c conda-forge pocl pyopencl==2021.2.11
conda install -c conda-forge pocl pyopencl
python -c 'import pyopencl as cl'
if: ${{ runner.os != 'Windows' }}
- name: Install dependencies
run: |
conda info
conda install -c conda-forge numpy cython
conda install -c conda-forge numpy cython h5py
python -m pip install https://github.com/pypr/cyarray/zipball/master
python -m pip install https://github.com/pypr/compyle/zipball/master
python -m pip install -r requirements.txt
python -m pip install -e ".[dev]"
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
requires = [
"Beaker",
"Cython>=0.20",
"compyle",
"compyle>=0.8",
"cyarray",
"mako",
"oldest-supported-numpy",
Expand Down
14 changes: 7 additions & 7 deletions pysph/base/gpu_domain_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from compyle.config import get_config
from compyle.array import Array, get_backend
from compyle.parallel import Elementwise, Reduction, Scan
from compyle.types import annotate, dtype_to_ctype
from compyle.types import annotate, declare

from pytools import memoize_method

Expand Down Expand Up @@ -162,8 +162,8 @@ def _box_wrap_periodic(self):
@memoize_method
def _get_ghosts_reduction_kernel(self):
@annotate
def map_func(i, periodic_in_x, periodic_in_y, periodic_in_z,
x, y, z, xmin, ymin, zmin, xmax, ymax, zmax, cell_size):
def map_func(i, x, y, z, xmin, ymin, zmin, xmax, ymax, zmax, cell_size,
periodic_in_x, periodic_in_y, periodic_in_z):
x_copies, y_copies, z_copies = declare('int', 3)

x_copies = 1
Expand Down Expand Up @@ -364,10 +364,10 @@ def _create_ghosts_periodic(self):
y = pa_wrapper.pa.gpu.y
z = pa_wrapper.pa.gpu.z

num_extra_particles = reduce_knl(periodic_in_x, periodic_in_y,
periodic_in_z, x, y, z, xmin,
ymin, zmin, xmax, ymax, zmax,
cell_size)
num_extra_particles = reduce_knl(x, y, z, xmin, ymin, zmin, xmax,
ymax, zmax, cell_size,
periodic_in_x, periodic_in_y,
periodic_in_z)

num_extra_particles = int(num_extra_particles)

Expand Down
4 changes: 2 additions & 2 deletions pysph/tools/binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def _write_readme_requrements(path):
Cython
h5py
meshio
https://github.com/pypr/cyarray/zipball/master
https://github.com/pypr/compyle/zipball/master
cyarray
compyle
https://github.com/pypr/pysph/zipball/master
''')
)
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest>=3.0
mock>=1.0
meshio
h5py
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
numpy
setuptools>=42.0.0
Cython>=0.20
https://github.com/pypr/cyarray/zipball/master
https://github.com/pypr/compyle/zipball/master
cyarray
compyle>=0.8
mako
pytools
Beaker
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,10 @@ def setup_package():

# The requirements.
install_requires = [
'numpy', 'mako', 'cyarray', 'compyle', 'Cython>=0.20',
'numpy', 'mako', 'cyarray', 'compyle>=0.8', 'Cython>=0.20',
'setuptools>=42.0.0', 'pytools', 'Beaker'
]
tests_require = ['pytest>=3.0', 'meshio']
tests_require = ['pytest>=3.0', 'h5py']
if sys.version_info[:2] == (2, 6):
install_requires += [
'ordereddict', 'importlib'
Expand Down

0 comments on commit aeadf6a

Please sign in to comment.