AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Performance.h
Go to the documentation of this file.
1/*
2 * This file is part of AQUAgpusph, a free CFD program based on SPH.
3 * Copyright (C) 2012 Jose Luis Cercos Pita <jl.cercos@upm.es>
4 *
5 * AQUAgpusph is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * AQUAgpusph is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with AQUAgpusph. If not, see <http://www.gnu.org/licenses/>.
17 */
18
24#ifndef PERFORMANCE_H_INCLUDED
25#define PERFORMANCE_H_INCLUDED
26
27#include <sys/time.h>
28#include <fstream>
30
31namespace Aqua{ namespace CalcServer{ namespace Reports{
32
44{
45public:
61 Performance(const std::string tool_name,
62 const std::string color="white",
63 bool bold=false,
64 const std::string output_file="");
65
69
72 void setup();
73
81 void execute(){std::vector<cl_event> null; _execute(null);}
82
83protected:
88
93 cl_event _execute(const std::vector<cl_event> events);
94
95private:
97 std::string _color;
99 bool _bold;
101 std::string _output_file;
105 timeval _tic;
112 bool _first_execution;
114 std::ofstream _f;
115};
116
117}}} // namespace
118
119#endif // PERFORMANCE_H_INCLUDED
Runtime output base class. (See Aqua::CalcServer::Reports::Report for details)
On screen performance output.
Definition: Performance.h:44
size_t computeAllocatedMemory()
Get the allocated memory.
Definition: Performance.cpp:85
~Performance()
Destructor.
Definition: Performance.cpp:57
void setup()
Initialize the tool.
Definition: Performance.cpp:62
void execute()
Launch _execute() without measuring the elapsed time.
Definition: Performance.h:81
cl_event _execute(const std::vector< cl_event > events)
Definition: Performance.cpp:102
Runtime outputs base class.
Definition: Report.h:49
Main AQUAgpusph namespace.
Definition: ArgumentsManager.cpp:45