Opencl datahandling
Since the target_dh_refactoring
was never merged, we decided to do the refactoring at smaller steps and recover the original OpenCL datahandling PR.
Refactoring to merge target
and backend
can be done later.
Merge request reports
Activity
Filter activity
Could you please apply
--- a/pystencils_tests/test_staggered_kernel.py +++ b/pystencils_tests/test_staggered_kernel.py @@ -4,13 +4,13 @@ import sympy as sp class TestStaggeredDiffusion: - def _run(self, num_neighbors): + def _run(self, num_neighbors, target='cpu'): L = (40, 40) D = 0.066 dt = 1 T = 100 - dh = ps.create_data_handling(L, periodicity=True, default_target='cpu') + dh = ps.create_data_handling(L, periodicity=True, default_target=target) c = dh.add_array('c', values_per_cell=1) j = dh.add_array('j', values_per_cell=num_neighbors, field_type=ps.FieldType.STAGGERED_FLUX) @@ -67,6 +67,11 @@ class TestStaggeredDiffusion: def test_diffusion_4(self): self._run(4) + @pytest.mark.skipif(not HAS_OPENCL, reason="Test requires pyopencl") + def test_diffusion_opencl(self): + import pystencils.opencl.autoinit + self._run(4, 'opencl') + def test_staggered_subexpressions(): dh = ps.create_data_handling((10, 10), periodicity=True, default_target='cpu')
That was the test I used two months ago and it still works after your rebase.
added 20 commits
- 880a3b6e - Add InterpolatorAccess.__getnewargs__
- 8aa4fe9f - Allow functions for Field.coordinate_transform
- fc24639d - Merge remote-tracking branch 'fork/InterpolatorAccess.__getnewargs__'
- ca134c22 - Also update Field.physical_to_index,index_to_physical for coordinate_transform as a function
- b508fbc3 - Lint
- 97ed02cf - Improve OpenCL integration via create_kernel
- c1afdc38 - Extend SerialDataHandling to handle alternative GPU libraries
- 190aafcd - Allow creation of indexed kernels with opencl
- f6ba722b - Let SerialDataHandling.synchronization_function work with target OpenCL
- bf7e314e - Teach SympyPrinters how to print Type
- b56d69d0 - Make SerialDataHandling.serialization_function work with OpenCL
- 5f7b9de4 - Add two helper functions to manage global cl ctx
- a08762bd - Add pystencils.opencl.autoinit
- 2e74f600 - Protect pystencils.opencl.autoinit with try..except
- 9221a1a0 - Add pycuda.autoinit to GPU test
- 66c37ce5 - Allow default_target=='opencl' in SerialDataHandling
- 87323f2b - Add friendly hint when calling OpenCL kernels with PyCUDA/Numpy arrays
- f917588e - Add weird construction to handle OpenCL boundary handling (don't show
- 38501e48 - Conftest ignore opencl.autoinit
- 218e868c - Simplify boundary handling with OpenCL
Toggle commit listadded 15 commits
- 85d72db7 - Improve OpenCL integration via create_kernel
- 3b2487c8 - Extend SerialDataHandling to handle alternative GPU libraries
- 489b8c1a - Allow creation of indexed kernels with opencl
- 96f3383d - Let SerialDataHandling.synchronization_function work with target OpenCL
- df8d438a - Teach SympyPrinters how to print Type
- d20202ed - Make SerialDataHandling.serialization_function work with OpenCL
- d30d1b92 - Add two helper functions to manage global cl ctx
- 60b3f9db - Add pystencils.opencl.autoinit
- f76d4b78 - Protect pystencils.opencl.autoinit with try..except
- 718d505c - Add pycuda.autoinit to GPU test
- 11401ba3 - Allow default_target=='opencl' in SerialDataHandling
- 0871a1e2 - Add friendly hint when calling OpenCL kernels with PyCUDA/Numpy arrays
- 0eb5693f - Add weird construction to handle OpenCL boundary handling (don't show
- 7465b426 - Conftest ignore opencl.autoinit
- a136fa22 - Simplify boundary handling with OpenCL
Toggle commit listenabled an automatic merge when the pipeline for 6e3c1582 succeeds
added 20 commits
-
6e3c1582...9b57cf87 - 4 commits from branch
pycodegen:master
- de753874 - Improve OpenCL integration via create_kernel
- e6a30483 - Extend SerialDataHandling to handle alternative GPU libraries
- 061ab58b - Allow creation of indexed kernels with opencl
- e02acf7d - Let SerialDataHandling.synchronization_function work with target OpenCL
- 585084e7 - Teach SympyPrinters how to print Type
- 0e56c1e3 - Make SerialDataHandling.serialization_function work with OpenCL
- 0b0ba401 - Add two helper functions to manage global cl ctx
- 5437459f - Add pystencils.opencl.autoinit
- 2901a5b5 - Protect pystencils.opencl.autoinit with try..except
- 62803d18 - Add pycuda.autoinit to GPU test
- de710402 - Allow default_target=='opencl' in SerialDataHandling
- 58e62e71 - Add friendly hint when calling OpenCL kernels with PyCUDA/Numpy arrays
- bb21c9b1 - Add weird construction to handle OpenCL boundary handling (don't show
- d08987c1 - Conftest ignore opencl.autoinit
- c989d8ae - Simplify boundary handling with OpenCL
- 226abc3a - test_staggered_kernel also for OpenCL
Toggle commit list-
6e3c1582...9b57cf87 - 4 commits from branch
enabled an automatic merge when the pipeline for 226abc3a succeeds
mentioned in commit 171d844a
Please register or sign in to reply