pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2024-03-28T14:36:48+01:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/370Fix typing of constants2024-03-28T14:36:48+01:00Daniel BauerFix typing of constantsThis is an umbrella MR combining a few small changes:
- Fixes typing of constants.
If a typed `Constant` inside of an untyped `ConstantExpr` was encountered, the typification used to fail (see new test).
- Strengthens `test_typify_int...This is an umbrella MR combining a few small changes:
- Fixes typing of constants.
If a typed `Constant` inside of an untyped `ConstantExpr` was encountered, the typification used to fail (see new test).
- Strengthens `test_typify_integer_binops` now that arbitrary expressions can be deferred.
- Increases the information content of two error messages.
- Fixes a typo.Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/348Fix integration pipeline2023-09-07T11:09:55+02:00Daniel BauerFix integration pipelineThis MR fixes several issues with the integration pipeline.
1. !349.
2. Fixes an oversight introduced in https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/344.
The issue was with expressions like:
```
a: scalar fl...This MR fixes several issues with the integration pipeline.
1. !349.
2. Fixes an oversight introduced in https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/344.
The issue was with expressions like:
```
a: scalar float = CastFunc(b: vector float, float)
```
The mentioned MR used `get_type_of_expression` to determine whether an expression will be vectorized.
That works in most cases due to type collation but fails for `CastFuncs`, which are always vectorized.
This MR replaces `get_type_of_expression` by a small helper function that checks whether an expression is entirely scalar or requires additional vector casts.Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/335Fix indexing for AMD GPUs2023-07-08T12:43:56+02:00Markus HolzerFix indexing for AMD GPUsDue to https://github.com/cupy/cupy/issues/7676 `BlockIndexing` did not work correctly on AMD GPUs. This is MR fixes it.Due to https://github.com/cupy/cupy/issues/7676 `BlockIndexing` did not work correctly on AMD GPUs. This is MR fixes it.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/331Implement Pinned GPU memory2023-06-24T08:23:36+02:00Markus HolzerImplement Pinned GPU memoryCPU arrys with an equivalent GPU array should be pinned. Further, this MR fixes non-aligned strides between CPU and GPU arrays.CPU arrys with an equivalent GPU array should be pinned. Further, this MR fixes non-aligned strides between CPU and GPU arrays.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/324[Fix] Absolut field access2023-04-03T15:18:43+02:00Markus Holzer[Fix] Absolut field accessIn !319 we started to make sure that the `Field.Access` keeps the property `is_absolut_access` even when sympys simplifications or substitutions kick in. However, there were a few parts missed which are added in this MRIn !319 we started to make sure that the `Field.Access` keeps the property `is_absolut_access` even when sympys simplifications or substitutions kick in. However, there were a few parts missed which are added in this MRMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/322[Fix] Matplotlib arrow rendering2023-03-28T09:23:11+02:00Markus Holzer[Fix] Matplotlib arrow renderingStarting from `matplotlib = 3.5`, pystencils' definition for 3D arrows is deprecated. Therefore, 3D stencils cannot be rendered anymore.
The exact issue is stated, e.g., here : https://github.com/matplotlib/matplotlib/issues/21688
F...Starting from `matplotlib = 3.5`, pystencils' definition for 3D arrows is deprecated. Therefore, 3D stencils cannot be rendered anymore.
The exact issue is stated, e.g., here : https://github.com/matplotlib/matplotlib/issues/21688
Fixes #67Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/319Resolve "Absolute access is probably not copied correctly after _eval_subs()"2023-03-31T17:05:29+02:00Nils KohlResolve "Absolute access is probably not copied correctly after _eval_subs()"Closes #66Closes #66Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/318[Fix] GPU Buffer with iteration slices2023-03-31T09:18:50+02:00Markus Holzer[Fix] GPU Buffer with iteration slicesGPU buffers did not work in combination with iteration slices before. This is resolved hereGPU buffers did not work in combination with iteration slices before. This is resolved hereMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/312Use common shape to resolve buffer access2022-12-22T09:41:41+01:00Markus HolzerUse common shape to resolve buffer accessPystencils assume that all fields have the same spatial shape. Thus the field access should also be resolved by one common field shape. This was violated in the GPU kernel creation and should be fixed with this MRPystencils assume that all fields have the same spatial shape. Thus the field access should also be resolved by one common field shape. This was violated in the GPU kernel creation and should be fixed with this MRMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/306Improve Vectorisation2023-05-02T10:07:49+02:00Markus HolzerImprove VectorisationThis MR fixes some bugs caused in the vectorisationThis MR fixes some bugs caused in the vectorisationMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/303Fix Regression from !3002022-10-10T22:31:56+02:00Markus HolzerFix Regression from !300In !300 all written field sizes are added to the SympyAssignment as unknown parameters. This solves the problem that all field sizes need to be passed as arguments when using NT stores with non-x86 architectures. However, it introduces t...In !300 all written field sizes are added to the SympyAssignment as unknown parameters. This solves the problem that all field sizes need to be passed as arguments when using NT stores with non-x86 architectures. However, it introduces two problems.
1. In all other cases these parameters are not used. Thus waLBerla fails in some cases when compiled with -Wall. Other than that it is not nice either to pass unused parameters.
2. For the GPU code generation problems arose with the usage of `get_parameters` in waLBerla:
https://i10git.cs.fau.de/pycodegen/pystencils/-/blob/master/pystencils/astnodes.py#L244
Overall it seems that the easiest way to fix the problem is to only pass the additional size arguments when needed and in no other cases.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/282Fix RoundOff problems2021-12-21T11:12:54+01:00Markus HolzerFix RoundOff problemsWhen printing Rationals with pystencils at the moment the number of digits which will be printed is only 15. This is not enough for DP and thus Error is introduced in the printed code...
The reason for this is the following line:
`str(e...When printing Rationals with pystencils at the moment the number of digits which will be printed is only 15. This is not enough for DP and thus Error is introduced in the printed code...
The reason for this is the following line:
`str(expr.evalf().num)`
Here it is important to know what is happening. First of all the Rational is evaluated with Sympy with 15 digits, because SymPy defaults to 15 digits when using `evalf`:
https://docs.sympy.org/latest/modules/evalf.html
but the story continues: `.num` is not a SymPy function !!!!
This comes from `mpmath` so the Rational is converted to an `sp.Float` and then to a `mpmath.ctx_mp_python.mpf`. And yet again `mpmath` provides also a notion of precision. This could be set with `mpmath.mp.dps = 30` for example. However, why should this be done in that way here anyway?
In this MR the `.num` function is removed and all `evalf` functions in `pystencils` are set to `evalf(17)`.
Note here that the `SymPy` printer on the other hand knows very well which precision it needs to provide. Thus when using a float inside the Assignment SymPy prints this correctly.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/274Fixed integer square root2021-11-17T15:50:41+01:00Markus HolzerFixed integer square rootInteger square roots must be detected as float32 if the simulation is setup for SP.Integer square roots must be detected as float32 if the simulation is setup for SP.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/263Fixed wrong type hints. Updated setup.py2021-09-16T22:47:01+02:00Jan HönigFixed wrong type hints. Updated setup.pyAdded authors and changed the package's email to a more general solution.Added authors and changed the package's email to a more general solution.Jan HönigJan Hönighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/262fixed create_kernel parameter data_type="float" to procucde single precision2021-09-14T18:35:29+02:00Christoph Altfixed create_kernel parameter data_type="float" to procucde single precisionCurrently if create_kernel(assignments, data_type="float") is used then the untyped symbols are typed with float64, since the np.dtype("float") creates this during the construction of a new TypedSymbol.
Since data_type or as it is calle...Currently if create_kernel(assignments, data_type="float") is used then the untyped symbols are typed with float64, since the np.dtype("float") creates this during the construction of a new TypedSymbol.
Since data_type or as it is called in cpu.create_kernel type_info can be an string of an C type, At least following the [documentation of cpu.create_kernel](https://i10git.cs.fau.de/pycodegen/pystencils/-/blob/master/pystencils/cpu/kernelcreation.py#L31) this behavior is a bit confusing, since typical the C type specifier "float" is meant to be single precision.
So I added a small function that just replaces "float" with "single" in the symbol_to_type dict, so the untyped symbols get the single precision type.Christoph AltChristoph Althttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/227Fix installation from git2021-03-15T10:42:15+01:00Markus HolzerFix installation from gitIf `pystencils` is installed from git and `cython` is not installed you get the error: `gcc: error: pystencils/boundaries/createindexlistcython.c: No such file or directory`. This is because the generated C file is not shipped and thus i...If `pystencils` is installed from git and `cython` is not installed you get the error: `gcc: error: pystencils/boundaries/createindexlistcython.c: No such file or directory`. This is because the generated C file is not shipped and thus it is not available.
On pypi the C-file is shipped and thus it works.
Fixes #14Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/223Fix benchmark generation2021-02-26T09:07:23+01:00Markus HolzerFix benchmark generationFixes the generation of small benchmarking code with kerncraft and likwid for vectorized and aligned kernels.Fixes the generation of small benchmarking code with kerncraft and likwid for vectorized and aligned kernels.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/217Add kerncraft templates2021-02-20T12:23:43+01:00Markus HolzerAdd kerncraft templatesThe kerncraft coupling works only if these templates are available.The kerncraft coupling works only if these templates are available.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/201Fixed build doc2020-12-21T11:37:55+01:00Markus HolzerFixed build docDue to an update of `sphinxcontrib-bibtex` a .bib file must be specified for the documentation to work.Due to an update of `sphinxcontrib-bibtex` a .bib file must be specified for the documentation to work.Michael Kuronmkuron@icp.uni-stuttgart.deMichael Kuronmkuron@icp.uni-stuttgart.dehttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/196FIX Quicktests2020-12-08T16:53:29+01:00Markus HolzerFIX QuicktestsVectorisation test case was always set to avx which is problematic on machines not having avx.Vectorisation test case was always set to avx which is problematic on machines not having avx.Stephan SeitzStephan Seitz