8 #ifndef OPENFPM_DATA_SRC_VECTOR_VECTOR_PERFORMANCE_TEST_HPP_
9 #define OPENFPM_DATA_SRC_VECTOR_VECTOR_PERFORMANCE_TEST_HPP_
11 #define NADD 128*128*128
16 BOOST_AUTO_TEST_CASE(vector_add_performance)
18 std::vector<double> times(N_STAT + 1);
21 for (
size_t j = 0 ; j < 8 ; j++)
23 for (
size_t i = 1 ; i < N_STAT+1 ; i++)
38 p.get<P::v>()[0] = 1.0;
39 p.get<P::v>()[1] = 2.0;
40 p.get<P::v>()[2] = 7.0;
42 p.get<P::t>()[0][0] = 10.0;
43 p.get<P::t>()[0][1] = 13.0;
44 p.get<P::t>()[0][2] = 8.0;
45 p.get<P::t>()[1][0] = 19.0;
46 p.get<P::t>()[1][1] = 23.0;
47 p.get<P::t>()[1][2] = 5.0;
48 p.get<P::t>()[2][0] = 4.0;
49 p.get<P::t>()[2][1] = 3.0;
50 p.get<P::t>()[2][2] = 11.0;
54 for (
size_t i = 0 ; i < NADD ; i++)
62 std::sort(times.begin(),times.end());
67 testsv.add(
"Vector add");
68 per_timesv.add(times[0]);
73 BOOST_AUTO_TEST_CASE(vector_performance_write_report)
78 std::cout <<
"Write vector report\n";
81 std::string per_dir(test_dir);
83 load_and_combine(per_dir + std::string(
"/previous_measurev"),y,per_timesv,testsv.size());
88 for (
size_t j = 0; j < y.get(0).size(); j++)
89 yn.add(
"config " + std::to_string(j));
95 options.title = std::string(
"Vector Performances");
96 options.yAxis = std::string(
"Time (seconds)");
97 options.xAxis = std::string(
"Benchmark");
98 options.stype = std::string(
"bars");
100 cg.addHTML(
"<h2>Vector performance test</h2>");
101 cg.AddColumsGraph(testsv,y,yn,options);
double getcputime()
Return the cpu time.
void start()
Start the timer.
Test structure used for several test.
Implementation of 1-D std::vector like structure.
Class for cpu time benchmarking.
void stop()
Stop the timer.