Skip to content

Commit

Permalink
Merged tictoc.hpp into util.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Jun 5, 2014
1 parent a5800b8 commit 291c935
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 58 deletions.
2 changes: 1 addition & 1 deletion amgcl/amgcl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ THE SOFTWARE.

#include <amgcl/backend/builtin.hpp>
#include <amgcl/relaxation/interface.hpp>
#include <amgcl/tictoc.hpp>
#include <amgcl/util.hpp>

namespace amgcl {

Expand Down
2 changes: 1 addition & 1 deletion amgcl/coarsening/aggregation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ THE SOFTWARE.

#include <amgcl/backend/builtin.hpp>
#include <amgcl/coarsening/detail/scaled_galerkin.hpp>
#include <amgcl/tictoc.hpp>
#include <amgcl/util.hpp>

namespace amgcl {
namespace coarsening {
Expand Down
2 changes: 1 addition & 1 deletion amgcl/coarsening/smoothed_aggregation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ THE SOFTWARE.

#include <amgcl/backend/builtin.hpp>
#include <amgcl/coarsening/detail/galerkin.hpp>
#include <amgcl/tictoc.hpp>
#include <amgcl/util.hpp>

namespace amgcl {
namespace coarsening {
Expand Down
55 changes: 0 additions & 55 deletions amgcl/tictoc.hpp

This file was deleted.

24 changes: 24 additions & 0 deletions amgcl/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@ THE SOFTWARE.

#include <stdexcept>


/* Performance measurement macros
*
* If AMGCL_PROFILING macro is defined at compilation, then TIC(name) and
* TOC(name) macros correspond to prof.tic(name) and prof.toc(name).
* amgcl::prof should be an instance of amgcl::profiler<> defined in a user
* code similar to:
* \code
* namespace amgcl { profiler<> prof; }
* \endcode
* If AMGCL_PROFILING is undefined, then TIC and TOC are noop macros.
*/
#ifdef AMGCL_PROFILING
# include <amgcl/profiler.hpp>
# define TIC(name) amgcl::prof.tic(name);
# define TOC(name) amgcl::prof.toc(name);
namespace amgcl {
extern profiler<> prof;
}
#else
# define TIC(name)
# define TOC(name)
#endif

#define AMGCL_DEBUG_SHOW(x) \
std::cout << std::setw(20) << #x << ": " \
<< std::setw(15) << std::setprecision(8) << std::scientific \
Expand Down

0 comments on commit 291c935

Please sign in to comment.