Bytecode: allow better compiler optimization of the main evaluation function
Use the __restrict__ GCC extension on double* pointers, to avoid aliasing. NB: the C “restrict” keyword does not exist in C++.mr#2134
parent
d71db85c71
commit
4313640f80
|
@ -985,7 +985,7 @@ Evaluate::print_expression(const Evaluate::it_code_type &expr_begin, const optio
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Evaluate::evaluateBlock(int it_, double *y, const double *ya, int y_size, double *x, int nb_row_x, double *params, const double *steady_y, double *u, int Per_u_, double *T, int T_nrows, map<int, double> &TEF, map<pair<int, int>, double> &TEFD, map<tuple<int, int, int>, double> &TEFDD, double *r, double *g1, double *jacob, double *jacob_exo, double *jacob_exo_det, bool evaluate, bool no_derivatives)
|
Evaluate::evaluateBlock(int it_, double *__restrict__ y, const double *__restrict__ ya, int y_size, double *__restrict__ x, int nb_row_x, double *__restrict__ params, const double *__restrict__ steady_y, double *__restrict__ u, int Per_u_, double *__restrict__ T, int T_nrows, map<int, double> &TEF, map<pair<int, int>, double> &TEFD, map<tuple<int, int, int>, double> &TEFDD, double *__restrict__ r, double *__restrict__ g1, double *__restrict__ jacob, double *__restrict__ jacob_exo, double *__restrict__ jacob_exo_det, bool evaluate, bool no_derivatives)
|
||||||
{
|
{
|
||||||
auto it_code { currentBlockBeginning() };
|
auto it_code { currentBlockBeginning() };
|
||||||
int var{0}, lag{0};
|
int var{0}, lag{0};
|
||||||
|
|
|
@ -77,7 +77,7 @@ private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BasicSymbolTable &symbol_table;
|
BasicSymbolTable &symbol_table;
|
||||||
void evaluateBlock(int it_, double *y, const double *ya, int y_size, double *x, int nb_row_x, double *params, const double *steady_y, double *u, int Per_u_, double *T, int T_nrows, map<int, double> &TEF, map<pair<int, int>, double> &TEFD, map<tuple<int, int, int>, double> &TEFDD, double *r, double *g1, double *jacob, double *jacob_exo, double *jacob_exo_det, bool evaluate, bool no_derivatives);
|
void evaluateBlock(int it_, double *__restrict__ y, const double *__restrict__ ya, int y_size, double *__restrict__ x, int nb_row_x, double *__restrict__ params, const double *__restrict__ steady_y, double *__restrict__ u, int Per_u_, double *__restrict__ T, int T_nrows, map<int, double> &TEF, map<pair<int, int>, double> &TEFD, map<tuple<int, int, int>, double> &TEFDD, double *__restrict__ r, double *__restrict__ g1, double *__restrict__ jacob, double *__restrict__ jacob_exo, double *__restrict__ jacob_exo_det, bool evaluate, bool no_derivatives);
|
||||||
|
|
||||||
bool steady_state;
|
bool steady_state;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue