Skip to content

Commit

Permalink
Commented out code for profiling on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mclements committed Aug 7, 2024
1 parent e162eb3 commit f0991ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Makevars
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
CXX_STD=C++11
PKG_CPPFLAGS = -I../inst/include
## PKG_LIBS = -lprofiler
VER=
CCACHE=ccache
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
SHLIB_CXXLD=g++$(VER)
FC=ccache gfortran$(VER)
#FC=gfortran
F77=$(CCACHE) gfortran$(VER)
F77=$(CCACHE) gfortran$(VER)
13 changes: 12 additions & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
#include <hesim/utils.h>

// #include <gperftools/profiler.h> // Profiling on Linux

/**
* Calculate the maximum value of each row in a matrix
Expand All @@ -25,4 +25,15 @@ arma::ucolvec C_rowmax_index(arma::mat x) {
return arma::index_max(x,1);
}

// // Profiling on Linux using Google perftools
// // [[Rcpp::export]]
// SEXP start_profiler(std::string str) {
// ProfilerStart(str.c_str());
// return R_NilValue;
// }

// // [[Rcpp::export]]
// SEXP stop_profiler() {
// ProfilerStop();
// return R_NilValue;
// }

0 comments on commit f0991ee

Please sign in to comment.