pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2021-11-02T21:51:26+01:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/267Small clean up2021-11-02T21:51:26+01:00Markus HolzerSmall clean upsmall clean upsmall clean upMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/152Skip llvm tests if llvmlite is not installed2020-06-03T09:18:40+02:00Stephan SeitzSkip llvm tests if llvmlite is not installedhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/160Skip 01_tutorial_getting_started if graphviz is not installed2020-07-09T15:29:03+02:00Stephan SeitzSkip 01_tutorial_getting_started if graphviz is not installedCell 19 of Tutorial 1 requires graphviz. Skip if not installed.
Alternative would be to execute this only if graphviz is installed.Cell 19 of Tutorial 1 requires graphviz. Skip if not installed.
Alternative would be to execute this only if graphviz is installed.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/234Sizeless vectorization2021-05-21T10:11:44+02:00Michael Kuronmkuron@icp.uni-stuttgart.deSizeless vectorizationSurprisingly easy follow-up to !232 to support sizeless ARM SVE and RISC-V V. It uses some ugly hacks to sneak C functions like `svcntb()` into places that expect Python integers. Python duck-typing and SymPy made it possible. Not sure w...Surprisingly easy follow-up to !232 to support sizeless ARM SVE and RISC-V V. It uses some ugly hacks to sneak C functions like `svcntb()` into places that expect Python integers. Python duck-typing and SymPy made it possible. Not sure whether this should be merged as-is, but making it nicer would require re-writing `CBackend`. At least I couldn't think of a better way to obtain the innermost loop counter and loop stop.Jan HönigJan Hönighttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/221Ship c-file with pypi2021-02-22T22:59:51+01:00Markus HolzerShip c-file with pypiShip the generated C-File for boundary creation with pypiShip the generated C-File for boundary creation with pypiMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/246ship C-file2021-05-11T09:31:17+02:00Markus Holzership C-fileShipping the generated C-files to pypi is a good idea since it is less error-prone. A New Cython version might deal with the provided pyx file in a way we did not intend.
In more detail the best practice can be found here:
http://blog.b...Shipping the generated C-files to pypi is a good idea since it is less error-prone. A New Cython version might deal with the provided pyx file in a way we did not intend.
In more detail the best practice can be found here:
http://blog.behnel.de/posts/ship-generated-c-code-or-not.htmlMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/285sharedmethodcache2022-03-16T10:20:00+01:00Frederik HennigsharedmethodcacheAdded a per-instance method cache decorator, which can be shared among multiple methods with the same signature.
`sharedmethodcache` allows memoization similarily to `functools.cache`, but for instance methods of classes. The cache dict...Added a per-instance method cache decorator, which can be shared among multiple methods with the same signature.
`sharedmethodcache` allows memoization similarily to `functools.cache`, but for instance methods of classes. The cache dictionary is added as a member to the method's owning instance. Further, multiple methods with the same signature (up to kwargs) may use the same cache dict by specifying the same `cache_id`. This makes sense for methods that produce the same results on identical inputs, but by different computational paths.
This decorator is currently employed in pycodegen/lbmpy!113 by [abstract_equilibrium.py](https://i10git.cs.fau.de/da15siwa/lbmpy/-/blob/zero_centered_storage/lbmpy/equilibrium/abstract_equilibrium.py), but surely, more use cases will follow.
Example:
```
class Fib:
def __init__(self):
self.fib_rec_called = 0
self.fib_iter_called = 0
@sharedmethodcache("fib_cache")
def fib_rec(self, n):
self.fib_rec_called += 1
return 1 if n <= 1 else self.fib_rec(n-1) + self.fib_rec(n-2)
@sharedmethodcache("fib_cache")
def fib_iter(self, n):
self.fib_iter_called += 1
f1, f2 = 0, 1
for i in range(n):
f2 = f1 + f2
f1 = f2 - f1
return f2
>>> fib = Fib()
>>> fib.fib_rec(13)
377
>>> fib.fib_cache
{(1,): 1,
(0,): 1,
(2,): 2,
(3,): 3,
(4,): 5,
(5,): 8,
(6,): 13,
(7,): 21,
(8,): 34,
(9,): 55,
(10,): 89,
(11,): 144,
(12,): 233,
(13,): 377}
>>> fib.fib_rec_called
14
>>> fib.fib_iter(11)
144
>>> fib.fib_iter_called
0
```https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/66Set assumptions for TypedSymbol/cast_func/IntegerFunctionTwoArgsMixIn the Sym...2019-09-30T14:11:05+02:00Stephan SeitzSet assumptions for TypedSymbol/cast_func/IntegerFunctionTwoArgsMixIn the SymPy wayAfter having a nearly week long discussion on assumptions in my SymPy PR, I got some idea of how the assumptions in SymPy are working.
It's interesting that you can use `Function.__new__(cls, integer=True)` for `UndefinedFunction`s li...After having a nearly week long discussion on assumptions in my SymPy PR, I got some idea of how the assumptions in SymPy are working.
It's interesting that you can use `Function.__new__(cls, integer=True)` for `UndefinedFunction`s like `Function('f', interger=True)` but not for subclassese of `Function`.
Now things like `(2*f.shape[0]).is_integer` are working.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/122SerialDataHandling: synchronization_function for tensor fields2020-01-16T10:57:16+01:00Michael Kuronmkuron@icp.uni-stuttgart.deSerialDataHandling: synchronization_function for tensor fieldsIt already worked on the CPU, just needed to remove the check. On the GPU, we use `itertools.product` to create the nested loop needed.It already worked on the CPU, just needed to remove the check. On the GPU, we use `itertools.product` to create the nested loop needed.Martin BauerMartin Bauerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/307Sane Defaults for CreateKernelConfig2022-10-25T11:16:04+02:00Markus HolzerSane Defaults for CreateKernelConfigBy default, the number type of float numbers should be the same as the default typeBy default, the number type of float numbers should be the same as the default typeMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/77Run opencl without pycuda2019-10-21T14:06:35+02:00Stephan SeitzRun opencl without pycudaFix #15
This includes !76.
If anyone wants to use textures on OpenCL, we need to decouple `TextureInterpolatedField` from CUDA.Fix #15
This includes !76.
If anyone wants to use textures on OpenCL, we need to decouple `TextureInterpolatedField` from CUDA.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/48RNG SIMD2021-02-12T22:31:36+01:00Michael Kuronmkuron@icp.uni-stuttgart.deRNG SIMDI've vectorized the Philox and AES-NI RNGs, fixes #12. I had to add a very minimal integer vectorization that only supports `int32`, `makeVec`, `+`, and loop counters. Also, the `RNGNode` now needs to know already during construction how...I've vectorized the Philox and AES-NI RNGs, fixes #12. I had to add a very minimal integer vectorization that only supports `int32`, `makeVec`, `+`, and loop counters. Also, the `RNGNode` now needs to know already during construction how it's vectorized, which is ugly, but could only be resolved by a better type system (#20). For the same reason, it is not possible to use a vectorized float RNG with double fields or vice versa. Also, we essentially discard half the random numbers in double precision mode because otherwise the number of variables we return would change between the vectorized and non-vectorized version, which is incompatible with the interface.
For the tests, we need to add `pip3 install randomgen` to the Dockerfile.Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/293Revisions2022-05-25T10:19:33+02:00Markus HolzerRevisionsRevisions for !292Revisions for !292Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/295Revision32022-05-23T17:28:23+02:00Markus HolzerRevision3More revisions due to !292More revisions due to !292Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/294Revision22022-05-23T14:33:55+02:00Markus HolzerRevision2More revisions for !292More revisions for !292Markus 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/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/330Replace PyCuda with CuPy2023-06-23T08:31:06+02:00Markus HolzerReplace PyCuda with CuPyReplaces [PyCuda](https://documen.tician.de/pycuda/) with [CuPy](https://cupy.dev/)
Advantages of [CuPy](https://cupy.dev/):
- AMD support
- probably higher maintained due to NVIDIA support
- SciPy compatible.
Fixes #70
Fixes #69Replaces [PyCuda](https://documen.tician.de/pycuda/) with [CuPy](https://cupy.dev/)
Advantages of [CuPy](https://cupy.dev/):
- AMD support
- probably higher maintained due to NVIDIA support
- SciPy compatible.
Fixes #70
Fixes #69Markus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/278Removed OpenCL2021-11-22T21:22:54+01:00Markus HolzerRemoved OpenCLThis MR removes OpenCL from pystencilsThis MR removes OpenCL from pystencilsMarkus HolzerMarkus Holzerhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/279Removed kerncraft2021-11-25T12:34:57+01:00Markus HolzerRemoved kerncraftKerncraft was not validated in pystencils and is at the moment not further maintained. Thus we remove it for now from pystencils.
Fixes #44Kerncraft was not validated in pystencils and is at the moment not further maintained. Thus we remove it for now from pystencils.
Fixes #44Markus HolzerMarkus Holzer