blob: 3341f05dc15be2f909f001d97b98854adf6acc9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Symbolically generated GPU-based LBM
Experimental generation of OpenCL kernels using SymPy, Mako and PyOpenCL.
* Implements a straight forward AB pattern
* All memory offsets are statically resolved
* Underlying symbolic formulation is optimized using CSE
* Characteristic constants of D2Q9 and D3Q27 are transparently recovered using only discrete velocities
## Performance
Theoretical maximum performance on tested hardware:
| GPU | Bandwidth | D2Q9 | | D3Q19 | | D3Q27 | |
| ------ | ----------- | ------ | ------ | ------ | ------ | ------ | ------ |
| | | single | double | single | double | single | double |
| K2200 | 63.2 GiB/s | 893 | 459 | 435 | 220 | 308 | 156 |
| P100 | 512.6 GiB/s | 7242 | 3719 | 3528 | 1787 | 2502 | 1262 |
### Maximum measured performance...
| GPU | D2Q9 | | D3Q19 | | D3Q27 | |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | single | double | single | double | single | double |
| K2200 | 843.4 | 326.4 | 423.2 | 163.8 | 303.0 | 116.0 |
| P100 | 6957.4 | 3585.0 | 3420.2 | 1763.8 | 2374.6 | 1259.6 |
### ...relative to theoretical maximum
| GPU | D2Q9 | | D3Q19 | | D3Q27 | |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | single | double | single | double | single | double |
| K2200 | 94.4% | 71.1% | 97.3% | 74.5% | 98.4% | 74.4% |
| P100 | 96.1% | 96.4% | 96.9% | 98.7% | 94.9% | 99.8% |
### CSE impact on P100
| CSE | D2Q9 | | D3Q19 | | D3Q27 | |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | single | double | single | double | single | double |
| No | 6957.4 | 2814.4 | 2581.8 | 998.8 | 1576.4 | 647.4 |
| Yes | 6922.4 | 3585.0 | 3420.2 | 1763.8 | 2374.6 | 1259.6 |
| CSE | D2Q9 | | D3Q19 | | D3Q27 | |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| | single | double | single | double | single | double |
| No | 96.1% | 75.7% | 73.2% | 55.9% | 63.0% | 51.3% |
| Yes | 95.6% | 96.4% | 96.9% | 98.7% | 94.9% | 99.8% |
For more details see the `results/` and `notebook/` directories.
## Visualization
Various real-time visualizations using OpenCL GL-interop are provided, e.g:
[![Lid driven cavity](https://img.youtube.com/vi/Y3UxNENB7Ic/0.jpg)](https://www.youtube.com/watch?v=Y3UxNENB7Ic)
[![Particles around a ball](https://img.youtube.com/vi/VG4qfXijcsE/0.jpg)](https://www.youtube.com/watch?v=VG4qfXijcsE)
[![Volumetric rendering](https://img.youtube.com/vi/HEBdttFrU1A/0.jpg)](https://www.youtube.com/watch?v=HEBdttFrU1A)
[![2d stream lines](https://img.youtube.com/vi/bpzFLiKdBlI/0.jpg)](https://www.youtube.com/watch?v=bpzFLiKdBlI)
[![Volumetric curl](https://img.youtube.com/vi/tt-qa0TXdGA/0.jpg)](https://www.youtube.com/watch?v=tt-qa0TXdGA)
Some fun fake fire:
[![Trugfeuer](https://img.youtube.com/vi/J6aXa46ZDsw/0.jpg)](https://www.youtube.com/watch?v=J6aXa46ZDsw)
|