pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2024-03-28T16:03:38+01:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/371Various fixes to constants2024-03-28T16:03:38+01:00Frederik HennigVarious fixes to constantsVarious fixes to constants:
- Make `PsConstant` immutable
- Add `interpret_as`/`reinterpret_as` to apply data types to constants
- Add docstrings to `PsConstant`
- Add out-of-bounds checking to constant creation
- Add test cas...Various fixes to constants:
- Make `PsConstant` immutable
- Add `interpret_as`/`reinterpret_as` to apply data types to constants
- Add docstrings to `PsConstant`
- Add out-of-bounds checking to constant creation
- Add test cases
- Remove long-obsolete and completely commented-out test filesFrederik HennigFrederik Hennighttps://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/368Integer functions2024-03-27T17:24:15+01:00Daniel BauerInteger functionsAdds support (freezing, typing, printing) for the following integer functions from `sympyextensions.integer_functions`:
- bit_shift_left
- bit_shift_right
- bitwise_and
- bitwise_or
- bitwise_xor
- int_div
- int_power_of_2
- modulo_floor...Adds support (freezing, typing, printing) for the following integer functions from `sympyextensions.integer_functions`:
- bit_shift_left
- bit_shift_right
- bitwise_and
- bitwise_or
- bitwise_xor
- int_div
- int_power_of_2
- modulo_floor
The following are left for future work because they can be conveniently implemented with an `if` *expression* (the ternary if operator `?:` in C) which is currently not available.
- modulo_ceil
- div_ceil
`div_floor` is also not implemented because to me the semantics of this function are unclear.
Is it supposed to compute $\lfloor \frac ab \rfloor$ (as the name suggests) or the C-like round-to-zero integer division (as the documentation suggests)?
The typifier tries to infer the integer type of the arguments/result and always raises if the type is non-integer.
Note that this can lead to cases in which an exception is raised because the inference fails.
For example `int_div(2, 3)` where both arguments are untyped constants.
This could be improved in the typifier, e.g. by adding type constraints to deferred constants (also left for future work).Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/367Improve comment support2024-03-25T15:37:14+01:00Daniel BauerImprove comment supportAdd comment support to `UndefinedSymbolsCollector`.Add comment support to `UndefinedSymbolsCollector`.Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/365Remove unnecessary files in .toml2024-01-16T11:32:26+01:00Markus HolzerRemove unnecessary files in .tomlIn the .toml file some files are listed that are not existingIn the .toml file some files are listed that are not existinghttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/364Refactor packaging, part I2024-01-15T14:20:27+01:00Frederik HennigRefactor packaging, part IRelates to pycodegen/pystencils#75.
Move all project info to `pyproject.toml`.
Tasks:
- [x] Static Project Info
- [x] Register and run versioneer
- [x] Register Cython extension modules
- [x] Clean up package data files & manifest
...Relates to pycodegen/pystencils#75.
Move all project info to `pyproject.toml`.
Tasks:
- [x] Static Project Info
- [x] Register and run versioneer
- [x] Register Cython extension modules
- [x] Clean up package data files & manifest
- [x] Remove `quicktest` action from `setup.py` and realize quicktests some other way -> introduced `quicktest.py`
Notes:
- The `quicktest` command in `setup.py` uses the `distutils` command interface, but `distutils` is deprecated since Python 3.10. We must find some other way to realize quicktests.Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/363Fix type equality checks2024-01-09T10:18:05+01:00Frederik HennigFix type equality checksUse `is`/`is not` instead of `==` when checking for equality of types. Fixes linter errors that recently appeared in the `flake8` checker.Use `is`/`is not` instead of `==` when checking for equality of types. Fixes linter errors that recently appeared in the `flake8` checker.Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/362Refactor source tree layout2024-01-16T08:50:38+01:00Frederik HennigRefactor source tree layoutRelates to pycodegen/pystencils#75.
- [x] Migrate package to `src` directory
- [x] Migrate tests to `tests` directory and update `pytest` configuration
- [x] Fix various pipelines and CI containers
(`pyproject.toml` migration was mo...Relates to pycodegen/pystencils#75.
- [x] Migrate package to `src` directory
- [x] Migrate tests to `tests` directory and update `pytest` configuration
- [x] Fix various pipelines and CI containers
(`pyproject.toml` migration was moved to pycodegen/pystencils!364)Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/361Fix typo in CustomCodeNode.__eq__2023-12-04T10:47:42+01:00Daniel BauerFix typo in CustomCodeNode.__eq__https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/360Update README.md2023-11-28T09:34:51+01:00Markus HolzerUpdate README.mdhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/357Print small integer powers as divisions/multiplications2023-10-13T08:33:59+02:00Daniel BauerPrint small integer powers as divisions/multiplicationsFixes #72.
After a longer discussion we decided to reintroduce the special logic into the printer after it was removed in 939241f2.
The problem is that it is simply impossible to keep Muls unevaluated in cut_loops.
Neither deep_copy nor...Fixes #72.
After a longer discussion we decided to reintroduce the special logic into the printer after it was removed in 939241f2.
The problem is that it is simply impossible to keep Muls unevaluated in cut_loops.
Neither deep_copy nor func(*args) works.
A logic-free printer simply goes against how SymPy works.
We can have it, but first we must switch to a SymPy free ast datastructure.Daniel BauerDaniel Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/356Indexed domain kernel2023-11-14T02:31:58+01:00Markus HolzerIndexed domain kernelThis MR introduces the possibility to introduce sp.IndexedBase objects in the kernel that form an outer loop for indexing the arrays in the inner loopsThis MR introduces the possibility to introduce sp.IndexedBase objects in the kernel that form an outer loop for indexing the arrays in the inner loopsMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/355Add function to prepend pragmas to loops2023-09-29T08:27:16+02:00Frederik HennigAdd function to prepend pragmas to loopsAdd a function to prepend `#pragma` directives to domain loops according to their nesting depth.
Useful for compiler-specific annotations and interactions, especially with less well-known niche compilers (like Fujitsu's ARM-compiler).Add a function to prepend `#pragma` directives to domain loops according to their nesting depth.
Useful for compiler-specific annotations and interactions, especially with less well-known niche compilers (like Fujitsu's ARM-compiler).Frederik HennigFrederik Hennighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/354Remove loadA/storeA from ISAs where it is the same as loadU/storeU2023-09-20T11:20:08+02:00Michael Kuronmkuron@icp.uni-stuttgart.deRemove loadA/storeA from ISAs where it is the same as loadU/storeUSmall follow-up to !351. There is no need to have separate but identical aligned and unaligned load/store instructions. This should also make the logic clearer to anyone in the future wondering why alignment and sizelessness don't go tog...Small follow-up to !351. There is no need to have separate but identical aligned and unaligned load/store instructions. This should also make the logic clearer to anyone in the future wondering why alignment and sizelessness don't go together.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/352[Fix] Printing of subtraction2023-09-15T02:23:32+02:00Markus Holzer[Fix] Printing of subtractionSubtraction is realised in SymPy with a multiplication of -1 and an addition. Since the -1 is casted in our typing system, it remains in the printer. This leads to many unnecessary number prints. We can avoid this by not casting the nega...Subtraction is realised in SymPy with a multiplication of -1 and an addition. Since the -1 is casted in our typing system, it remains in the printer. This leads to many unnecessary number prints. We can avoid this by not casting the negative oneMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/351[FIX] Alignement detection2023-09-19T20:22:27+02:00Markus Holzer[FIX] Alignement detectionFor the SIMD vectorization it needs to be determined if a memory address lies points to an aligned address or not. This detection only worked for pointers depending on the inner loop counter so far.For the SIMD vectorization it needs to be determined if a memory address lies points to an aligned address or not. This detection only worked for pointers depending on the inner loop counter so far.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/350Reveal base pointer spec2023-09-14T20:54:35+02:00Markus HolzerReveal base pointer specThis MR reveals the base pointer specification to the user in the configThis MR reveals the base pointer specification to the user in the configMarkus HolzerMarkus Holzerhttps://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/347Distinguish between SymPy and pystencils Assignement better2023-08-29T10:29:02+02:00Markus HolzerDistinguish between SymPy and pystencils Assignement betterThis MR clears the usage of SympyAssignement in contrast to the sympy assignement.
In the backend of pystencils only SympyAssignements are used now that inherit from pystencils base Node class
fixes #61
Additionally, AddAugumentedAss...This MR clears the usage of SympyAssignement in contrast to the sympy assignement.
In the backend of pystencils only SympyAssignements are used now that inherit from pystencils base Node class
fixes #61
Additionally, AddAugumentedAssignement is introduced for convenienceMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/346Extension to field read extraction2023-08-24T09:47:32+02:00Markus HolzerExtension to field read extractionWith `add_subexpressions_for_field_reads` it is possible to extract field reads from the kernel and put them in individual assignements. For mixed precision kernels, however, it is useful if the lhs of this new assignement is of given ty...With `add_subexpressions_for_field_reads` it is possible to extract field reads from the kernel and put them in individual assignements. For mixed precision kernels, however, it is useful if the lhs of this new assignement is of given type. This isolates casts and prevents calculations in the data type of the stored valuesMarkus HolzerMarkus Holzer