WSL/SLF GitLab Repository

Commit dd0eaf9e authored by Adrien Michel's avatar Adrien Michel
Browse files

Added profile option

parent 59df069e
......@@ -12,6 +12,28 @@ errorPatternCpp <- function(data1, data2, bin_h, bin_v, elevation, slope, azi, c
.Call(`_SnowQM_errorPatternCpp`, data1, data2, bin_h, bin_v, elevation, slope, azi, curvature, ncores)
}
#' start_profiler
#'
#' This function returns a logical vector identifying if
#' there are leading NA, marking the leadings NA as TRUE and
#' everything else as FALSE.
#' @param x An integer vector
#' @export
start_profiler <- function(str) {
.Call(`_SnowQM_start_profiler`, str)
}
#' stop_profiler
#'
#' This function returns a logical vector identifying if
#' there are leading NA, marking the leadings NA as TRUE and
#' everything else as FALSE.
#' @param x An integer vector
#' @export
stop_profiler <- function() {
.Call(`_SnowQM_stop_profiler`)
}
#' applyQMCpp
#'
#' This function returns a logical vector identifying if
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{start_profiler}
\alias{start_profiler}
\title{start_profiler}
\usage{
start_profiler(str)
}
\arguments{
\item{x}{An integer vector}
}
\description{
This function returns a logical vector identifying if
there are leading NA, marking the leadings NA as TRUE and
everything else as FALSE.
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{stop_profiler}
\alias{stop_profiler}
\title{stop_profiler}
\usage{
stop_profiler()
}
\arguments{
\item{x}{An integer vector}
}
\description{
This function returns a logical vector identifying if
there are leading NA, marking the leadings NA as TRUE and
everything else as FALSE.
}
SHLIB_OPENMP_CFLAGS?=-fopenmp
SHLIB_OPENMP_CXXFLAGS?=-fopenmp
PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) -fopenmp
PKG_CXXFLAGS = $(SHLIB_OPENMP_CFLAGS) -Wpedantic -O3 -std=c++11 -fopenmp
\ No newline at end of file
PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS) -lprofiler -pg
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) -fopenmp -lprofiler -pg
PKG_CXXFLAGS = $(SHLIB_OPENMP_CFLAGS) -Wpedantic -O3 -std=c++11 -fopenmp -lprofiler -pg
\ No newline at end of file
......@@ -29,6 +29,27 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// start_profiler
SEXP start_profiler(SEXP str);
RcppExport SEXP _SnowQM_start_profiler(SEXP strSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< SEXP >::type str(strSEXP);
rcpp_result_gen = Rcpp::wrap(start_profiler(str));
return rcpp_result_gen;
END_RCPP
}
// stop_profiler
SEXP stop_profiler();
RcppExport SEXP _SnowQM_stop_profiler() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(stop_profiler());
return rcpp_result_gen;
END_RCPP
}
// applyQMCpp
Rcpp::NumericVector applyQMCpp(const Rcpp::NumericMatrix swe, const Rcpp::NumericVector doyArray, const Rcpp::NumericVector xCoords, const Rcpp::NumericVector yCoords, const std::string sourcePath, const std::string targetPath, const size_t ncores);
RcppExport SEXP _SnowQM_applyQMCpp(SEXP sweSEXP, SEXP doyArraySEXP, SEXP xCoordsSEXP, SEXP yCoordsSEXP, SEXP sourcePathSEXP, SEXP targetPathSEXP, SEXP ncoresSEXP) {
......@@ -158,6 +179,8 @@ END_RCPP
static const R_CallMethodDef CallEntries[] = {
{"_SnowQM_errorPatternCpp", (DL_FUNC) &_SnowQM_errorPatternCpp, 9},
{"_SnowQM_start_profiler", (DL_FUNC) &_SnowQM_start_profiler, 1},
{"_SnowQM_stop_profiler", (DL_FUNC) &_SnowQM_stop_profiler, 0},
{"_SnowQM_applyQMCpp", (DL_FUNC) &_SnowQM_applyQMCpp, 7},
{"_SnowQM_computeQuantilesCpp", (DL_FUNC) &_SnowQM_computeQuantilesCpp, 8},
{"_SnowQM_computeSeasonnalSummaryCpp", (DL_FUNC) &_SnowQM_computeSeasonnalSummaryCpp, 4},
......
#include <Rcpp.h>
#include "gperftools/profiler.h"
using namespace Rcpp;
//' start_profiler
//'
//' This function returns a logical vector identifying if
//' there are leading NA, marking the leadings NA as TRUE and
//' everything else as FALSE.
//' @param x An integer vector
//' @export
// [[Rcpp::export]]
SEXP start_profiler(SEXP str) {
ProfilerStart(as<const char*>(str));
return R_NilValue;
}
//' stop_profiler
//'
//' This function returns a logical vector identifying if
//' there are leading NA, marking the leadings NA as TRUE and
//' everything else as FALSE.
//' @param x An integer vector
//' @export
// [[Rcpp::export]]
SEXP stop_profiler() {
ProfilerStop();
return R_NilValue;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment