1 /**
2  * Copyright 2013-2016 Andreas Schäfer
3  *
4  * Distributed under the Boost Software License, Version 1.0. (See accompanying
5  * file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
6  */
7 
8 #include <cuda.h>
9 #include <sstream>
10 
11 #include "cell.h"
12 #include "util.h"
13 #include "update_lbm_classic.h"
14 #include "update_lbm_object_oriented.h"
15 #include "update_lbm_cuda_flat_array.h"
16 
main(int argc,char ** argv)17 int main(int argc, char **argv)
18 {
19     if (argc != 2) {
20         std::cerr << "usage: " << argv[0] << " CUDA_DEVICE\n";
21         return 1;
22     }
23 
24     std::stringstream s;
25     s << argv[1];
26     int cudaDevice;
27     s >> cudaDevice;
28     cudaSetDevice(cudaDevice);
29 
30     std::cout << "# test name              ; dim ; performance\n";
31     benchmark_lbm_cuda_object_oriented().evaluate();
32     benchmark_lbm_cuda_classic().evaluate();
33     benchmark_lbm_cuda_flat_array().evaluate();
34 
35     return 0;
36 }
37