Skip to content

Commit

Permalink
Adding the cores arg
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Sep 27, 2023
1 parent bf2ace6 commit c57353c
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 74 deletions.
7 changes: 7 additions & 0 deletions include/barry/barry-macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@

#define BARRY_UNUSED(expr) do { (void)(expr); } while (0);

#if defined(_OPENMP) || defined(__OPENMP)
#define BARRY_NCORES_ARG(default) size_t ncores default
#else
#define BARRY_NCORES_ARG(default) size_t
#endif


#endif
15 changes: 10 additions & 5 deletions include/barry/model-bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,33 +240,38 @@ class Model {
double likelihood(
const std::vector<double> & params,
const size_t & i,
bool as_log = false
bool as_log = false,
BARRY_NCORES_ARG(=2)
);

double likelihood(
const std::vector<double> & params,
const Array_Type & Array_,
int i = -1,
bool as_log = false
bool as_log = false,
BARRY_NCORES_ARG(=2)
);

double likelihood(
const std::vector<double> & params,
const std::vector<double> & target_,
const size_t & i,
bool as_log = false
bool as_log = false,
BARRY_NCORES_ARG(=2)
);

double likelihood(
const std::vector<double> & params,
const double * target_,
const size_t & i,
bool as_log = false
bool as_log = false,
BARRY_NCORES_ARG(=2)
);

double likelihood_total(
const std::vector<double> & params,
bool as_log = false
bool as_log = false,
BARRY_NCORES_ARG(=2)
);
///@}

Expand Down
Loading

0 comments on commit c57353c

Please sign in to comment.