pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2020-01-14T14:09:15+01:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/120Add DataHandling.add_arrays2020-01-14T14:09:15+01:00Stephan SeitzAdd DataHandling.add_arraysThis adds a function for lazy people who want to write
```python
dh = create_data_handling((20, 30))
x, y, z = dh.add_arrays('x, y(9), z')
```
instead of
```python
dh = create_data_handling((20, 30))
dh.add_array('x')
dh.a...This adds a function for lazy people who want to write
```python
dh = create_data_handling((20, 30))
x, y, z = dh.add_arrays('x, y(9), z')
```
instead of
```python
dh = create_data_handling((20, 30))
dh.add_array('x')
dh.add_array('y', values_per_cell=9)
dh.add_array('z')
```
because in most cases you want to use more than one array.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/119Opencl datahandling2020-01-10T10:22:59+01:00Stephan SeitzOpencl datahandlingSince 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.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.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/118Allow functions for Field.coordinate_transform2020-01-09T20:20:23+01:00Stephan SeitzAllow functions for Field.coordinate_transformThis lets you quickly switch to polar coordinate systems:
```python
field.coordinate_transform = lambda x: sympy.Matrix((x.norm(), sympy.atan2(*x) / (2 * sympy.pi) * field.shape[1]))
```This lets you quickly switch to polar coordinate systems:
```python
field.coordinate_transform = lambda x: sympy.Matrix((x.norm(), sympy.atan2(*x) / (2 * sympy.pi) * field.shape[1]))
```https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/117WIP: Add InterpolatorAccess.__getnewargs__2020-01-28T14:23:15+01:00Stephan SeitzWIP: Add InterpolatorAccess.__getnewargs__it was missing and instead TypedSymbol.__getnewargs__ was usedit was missing and instead TypedSymbol.__getnewargs__ was usedhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/116Throw error when trying to sympify `pystencils.Field` (e.g. using it in an...2020-01-03T13:24:14+01:00Stephan SeitzThrow error when trying to sympify `pystencils.Field` (e.g. using it in an...Throw error when trying to sympify `pystencils.Field` (e.g. using it in an Assignment without indexing)
This is a typical error when using pystencils: you forget the index and use a field directly in an Assignment.
Edit: apparently...Throw error when trying to sympify `pystencils.Field` (e.g. using it in an Assignment without indexing)
This is a typical error when using pystencils: you forget the index and use a field directly in an Assignment.
Edit: apparently, this error is only triggered on recent versions of Sympy that can sympify using `__sympy__` (not on CI).https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/115:star: :star: :star: Add a star to correctly get atoms of InterpolatorAccess ...2019-12-19T15:40:16+01:00Stephan Seitz:star: :star: :star: Add a star to correctly get atoms of InterpolatorAccess :star: :star: :star:https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/114Fix AssignmentCollection.{free_symbols,bound_symbols,defined_symbols} for non...2019-12-19T23:28:04+01:00Stephan SeitzFix AssignmentCollection.{free_symbols,bound_symbols,defined_symbols} for non-AssignmentsThis should allow to execute AssignmentCollection.{free_symbols,bound_symbols,symbols_defined} on AssignmentCollection that do not exclusively contain `pystencils.Assignments`.
Should fix lbmpy tests (let's see if that's true).This should allow to execute AssignmentCollection.{free_symbols,bound_symbols,symbols_defined} on AssignmentCollection that do not exclusively contain `pystencils.Assignments`.
Should fix lbmpy tests (let's see if that's true).https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/113Test pystencils_autodiff in integration test2020-01-08T13:49:44+01:00Stephan SeitzTest pystencils_autodiff in integration testhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/112Add CI minimal CI test for old sympy2019-12-17T18:51:26+01:00Stephan SeitzAdd CI minimal CI test for old sympyThe minimal test cannot catch everything but its something.The minimal test cannot catch everything but its something.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/111Test pystencils_autodiff in integration test2019-12-17T18:56:19+01:00Stephan SeitzTest pystencils_autodiff in integration testhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/110Update AssignmentCollection.__repr__2019-12-18T21:14:57+01:00Stephan SeitzUpdate AssignmentCollection.__repr__`Assignment Collection for y[0,0,0]` is usually not very helpful.
New representation:
```
In [6]: forward_assignments = pystencils.AssignmentCollection({
...: z[0, 0]: x[0, 0] * sympy.log(x[0, 0] * y[0, 0]),
...: ...`Assignment Collection for y[0,0,0]` is usually not very helpful.
New representation:
```
In [6]: forward_assignments = pystencils.AssignmentCollection({
...: z[0, 0]: x[0, 0] * sympy.log(x[0, 0] * y[0, 0]),
...: y[0,0] : x[1,1] +1
...: })
In [7]: forward_assignments
Out[7]: AssignmentCollection: z_C, y_C <- f(x_C, x_NE)
```https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/109FiniteDifferenceStaggeredStencilDerivation must be applied to field access2019-12-18T21:15:21+01:00Michael Kuronmkuron@icp.uni-stuttgart.deFiniteDifferenceStaggeredStencilDerivation must be applied to field accessotherwise the index gets lost.
Also, fix the staggered field access prettyprinter. It was correct after !86 but printed wrong indices after !92. I have now added a test.otherwise the index gets lost.
Also, fix the staggered field access prettyprinter. It was correct after !86 but printed wrong indices after !92. I have now added a test.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/108AssignmentCollection.__bool__2019-12-17T13:30:15+01:00Stephan SeitzAssignmentCollection.__bool__`AssignmentCollection` can be used in many cases where you could also use
a `List[Assignment]`. With `AssignmentCollection.__bool__`, an empty
AssignmentCollection is falsy and a non-empty one truthy.
So you can `assert assignments,...`AssignmentCollection` can be used in many cases where you could also use
a `List[Assignment]`. With `AssignmentCollection.__bool__`, an empty
AssignmentCollection is falsy and a non-empty one truthy.
So you can `assert assignments, 'must not be emtpy'`https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/107Allow `CUSTOM_FIELD`s to have a different size in transformations.py2019-12-17T13:16:06+01:00Stephan SeitzAllow `CUSTOM_FIELD`s to have a different size in transformations.pyhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/106WIP: Cuda autotune2020-10-07T13:04:35+02:00Stephan SeitzWIP: Cuda autotuneThis PR introduces ~~two~~ one change~~s~~:
- ~~rotate (32,1,1) depending on field strides to fastest dimension. So (1,1,32) for c-layout and (32,1,1) for fortran layout. So pystencils will be fast also for c-layout (this will always be...This PR introduces ~~two~~ one change~~s~~:
- ~~rotate (32,1,1) depending on field strides to fastest dimension. So (1,1,32) for c-layout and (32,1,1) for fortran layout. So pystencils will be fast also for c-layout (this will always be performed)~~
- auto-tune the block dimensions to whatevers is fastest for a specific kernel on localhost. On first kernel call different layouts are tried and the kernel will be called henceforth with the fastest configuration (disk_cached). This could be intersting for OpenCL where we don't know which launch config is the fastest (on OpenCL the runtime can alternatively give a hint on that).
One drawback: the test calls are only correct if input and output fields do not overlap (so no in-place kernels).https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/105Fix FiniteDifferenceStaggeredStencilDerivation on Sympy 1.12019-12-16T15:05:39+01:00Michael Kuronmkuron@icp.uni-stuttgart.deFix FiniteDifferenceStaggeredStencilDerivation on Sympy 1.1I broke it in !104I broke it in !104Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/104Minor improvements to FiniteDifferenceStaggeredStencilDerivation2019-12-06T20:20:51+01:00Michael Kuronmkuron@icp.uni-stuttgart.deMinor improvements to FiniteDifferenceStaggeredStencilDerivationMartin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/103Fix printing for Functions without name2019-12-05T13:17:02+01:00Stephan SeitzFix printing for Functions without nameThis fixes test for LLVM GPU using pointer_arith_funcThis fixes test for LLVM GPU using pointer_arith_funchttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/102Fix OpenCL for CUDA OpenCL by avoid int(...) constructor2019-12-05T13:17:16+01:00Stephan SeitzFix OpenCL for CUDA OpenCL by avoid int(...) constructorPrefer c-style cast instead.Prefer c-style cast instead.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/101WIP: Add csqrt, cpow to cuda_complex.hpp2021-11-22T15:41:05+01:00Stephan SeitzWIP: Add csqrt, cpow to cuda_complex.hppApparently, I'm using here a feature of a more recent C++ verion.
Specializing `cpow(T)` to `cpow(complex<T>)`Apparently, I'm using here a feature of a more recent C++ verion.
Specializing `cpow(T)` to `cpow(complex<T>)`