pystencils merge requestshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests2019-10-29T10:31:47+01:00https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/82Add Field.itemsize (yields Field.dtype.numpy_dtype.itemsize)2019-10-29T10:31:47+01:00Stephan SeitzAdd Field.itemsize (yields Field.dtype.numpy_dtype.itemsize)https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/81Oops, forgot a return in TextureCachedField.reproducible_hash2019-10-28T13:26:22+01:00Stephan SeitzOops, forgot a return in TextureCachedField.reproducible_hashhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/80Use reproducible hashlib for representing TextureCachedField2019-10-28T12:38:04+01:00Stephan SeitzUse reproducible hashlib for representing TextureCachedFieldTextureCachedField was using `hash(...)` to disambiguate its instances.
However, `hash` is randomized and will hinder reproducible code
generationTextureCachedField was using `hash(...)` to disambiguate its instances.
However, `hash` is randomized and will hinder reproducible code
generationhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/79Add sympy to known_third_party in .isort.cfg2019-10-28T11:33:12+01:00Stephan SeitzAdd sympy to known_third_party in .isort.cfgI have installed the newest master of SymPy as editable package.
So `isort` thinks it's one of our libraries.
With this config SymPy is declared as a third party dependency.I have installed the newest master of SymPy as editable package.
So `isort` thinks it's one of our libraries.
With this config SymPy is declared as a third party dependency.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/78correctly print RNG nodes2019-10-21T14:05:18+02:00Michael Kuronmkuron@icp.uni-stuttgart.decorrectly print RNG nodesRegular assignments also use `\\leftarrow`. `<-` looks odd in Jupyter because it renders like `< -PhiloxRNG`, where it looks like less than minus.Regular assignments also use `\\leftarrow`. `<-` looks odd in Jupyter because it renders like `< -PhiloxRNG`, where it looks like less than minus.Martin BauerMartin Bauerhttps://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/76Fix OpenCL with older Sympy and pyopencl versions2019-10-21T14:06:35+02:00Michael Kuronmkuron@icp.uni-stuttgart.deFix OpenCL with older Sympy and pyopencl versionsI'm using sympy and pyopencl from the Ubuntu 18.04 repositories and these changes were required to make the OpenCL tests pass on an Nvidia machine. AMD doesn't work, see #15.I'm using sympy and pyopencl from the Ubuntu 18.04 repositories and these changes were required to make the OpenCL tests pass on an Nvidia machine. AMD doesn't work, see #15.Stephan SeitzStephan Seitzhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/75Add option to omit globals when printing C code2019-10-21T14:06:59+02:00Stephan SeitzAdd option to omit globals when printing C codeRight know, needed globals are always printed. But this is not always desired, e.g. when printing multiple functions and all globals should be on top of file.Right know, needed globals are always printed. But this is not always desired, e.g. when printing multiple functions and all globals should be on top of file.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/74Add __str__ representation for TextureDeclaration2019-10-21T14:07:20+02:00Stephan SeitzAdd __str__ representation for TextureDeclarationhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/73Bugfix: textures should be implemented as textures without changes2019-10-21T14:07:44+02:00Stephan SeitzBugfix: textures should be implemented as textures without changesFixes a small bug when using textures directly. Textures where different despite having the same hash.Fixes a small bug when using textures directly. Textures where different despite having the same hash.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/72Support complex numbers2023-01-02T23:44:24+01:00Stephan SeitzSupport complex numbersOnly down side in the moment is that `complex<double>` and `complex<float>` must never be mixed in a kernel (real scalars of the other type are mostly ok due to manually implemented templates).
Should work on CPU and GPU.
Another thing...Only down side in the moment is that `complex<double>` and `complex<float>` must never be mixed in a kernel (real scalars of the other type are mostly ok due to manually implemented templates).
Should work on CPU and GPU.
Another thing that this PR changes is that also the `headers` attribute of SymPy Expression is checked to determine necessary headers.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/71Fix printing of sp.Infinity/sp.NegativeInfinity2019-10-10T21:36:11+02:00Stephan SeitzFix printing of sp.Infinity/sp.NegativeInfinityFor sympy, oo s a number. So pystencils prints a double
INFINITY as INFINITY.0For sympy, oo s a number. So pystencils prints a double
INFINITY as INFINITY.0https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/70Fix error in README.md: pystencils[pyopencl] -> pystencils[opencl]2019-10-09T11:52:53+02:00Stephan SeitzFix error in README.md: pystencils[pyopencl] -> pystencils[opencl]Align `README.md` with `setup.py`Align `README.md` with `setup.py`https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/69Small fixes2019-10-01T15:12:52+02:00Stephan SeitzSmall fixeshttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/68Declare LoopCounterSymbols nonnegative2019-10-01T15:12:29+02:00Stephan SeitzDeclare LoopCounterSymbols nonnegativeThis removed some checks like `ctr1 <= 0` from my kernelsThis removed some checks like `ctr1 <= 0` from my kernelshttps://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/65Bugfix: Align calculation of number of ghost layers on GPU with CPU version2019-09-30T14:10:47+02:00Stephan SeitzBugfix: Align calculation of number of ghost layers on GPU with CPU versionFor the calculation of the number of ghostlayers only relative accesses
should be considered like on the CPU versionFor the calculation of the number of ghostlayers only relative accesses
should be considered like on the CPU versionhttps://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/64Bugfix avoid east and west const2019-09-30T14:10:05+02:00Stephan SeitzBugfix avoid east and west constHere's the printing logic for SympyAsssignment:
```python
if node.is_declaration:
if node.is_const # <<< and 'const' not in self._print(node.lhs.dtype):
prefix = 'const '
else:
...Here's the printing logic for SympyAsssignment:
```python
if node.is_declaration:
if node.is_const # <<< and 'const' not in self._print(node.lhs.dtype):
prefix = 'const '
else:
prefix = ''
data_type = prefix + self._print(node.lhs.dtype) + " "
return "%s%s = %s;" % (data_type, self.sympy_printer.doprint(node.lhs),
self.sympy_printer.doprint(node.rhs))
else:
lhs_type = get_type_of_expression(node.lhs)
if type(lhs_type) is VectorType and isinstance(node.lhs, cast_func):
```
It will always prefix const on a declaration. This will not work if dtype is also const since:
```python
def __str__(self):
result = BasicType.numpy_name_to_c(str(self._dtype))
if self.const:
result += " const"
return result
```
So we get something like `const int64_t const`.
I deleted the postfix const to have everything nicely aligned.https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/63Bugfix: this bracket should not be here (collate_types returns single type)2019-09-30T14:10:58+02:00Stephan SeitzBugfix: this bracket should not be here (collate_types returns single type)https://i10git.cs.fau.de/pycodegen/pystencils/-/merge_requests/62Bugfix fields accessed for interpolator access2019-09-30T14:10:31+02:00Stephan SeitzBugfix fields accessed for interpolator access