summaryrefslogtreecommitdiff
path: root/lbm.org
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-09-07 20:42:14 +0200
committerAdrian Kummerlaender2021-09-07 20:45:59 +0200
commit03c9a7b60cd34358b9df7bb8ce31b5692d40555b (patch)
tree06e83510db0af07e255690f0ee54ef6439b006b4 /lbm.org
parent8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7 (diff)
downloadLiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.tar
LiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.tar.gz
LiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.tar.bz2
LiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.tar.lz
LiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.tar.xz
LiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.tar.zst
LiterateLB-03c9a7b60cd34358b9df7bb8ce31b5692d40555b.zip
Remove double precision storage support for benchmark
Single precision only requires half the bandwidth and is generally good enough for applications.
Diffstat (limited to 'lbm.org')
-rw-r--r--lbm.org25
1 files changed, 5 insertions, 20 deletions
diff --git a/lbm.org b/lbm.org
index afe1d23..059a579 100644
--- a/lbm.org
+++ b/lbm.org
@@ -5794,11 +5794,12 @@ In order to benchmark the performance limits of our LBM code this example implem
a lid driven cavity without any visual output.
#+BEGIN_SRC cpp :tangle tangle/benchmark-ldc.cu
+using T = float;
using DESCRIPTOR = descriptor::D3Q19;
#+END_SRC
-As 3D simulations are generally what is of relevance for practical applications we are
-using a =D3Q19= lattice of single and double precision values.
+As 3D simulations are generally what is of relevance for practical applications, we are
+using a =D3Q19= lattice of single precision values.
#+NAME: benchmark-ldc-setup-lattice
#+BEGIN_SRC cpp
@@ -5835,7 +5836,6 @@ The =simulate= function accepts a the cuboid configuration together with a step
and the floating point type to be used for lattice data and computations.
#+BEGIN_SRC cpp :tangle tangle/benchmark-ldc.cu
-template <typename T>
void simulate(descriptor::Cuboid<DESCRIPTOR> cuboid, std::size_t nStep) {
cudaSetDevice(0);
@@ -5866,7 +5866,7 @@ some very basic CLI parameter handling in the =main= function.
#+BEGIN_SRC cpp :tangle tangle/benchmark-ldc.cu
int main(int argc, char* argv[]) {
- if (argc < 3 || argc > 4) {
+ if (argc != 3) {
std::cerr << "Invalid parameter count" << std::endl;
return -1;
}
@@ -5874,22 +5874,7 @@ int main(int argc, char* argv[]) {
const std::size_t n = atoi(argv[1]);
const std::size_t steps = atoi(argv[2]);
- unsigned precision = 4;
- if (argc == 4) {
- precision = atoi(argv[3]);
- }
-
- switch (precision) {
- case 4:
- simulate<float>({ n, n, n}, steps);
- break;
- case 8:
- simulate<double>({ n, n, n}, steps);
- break;
- default:
- std::cerr << "Invalid precision" << std::endl;
- return -1;
- }
+ simulate({ n, n, n}, steps);
return 0;
}