diff --git a/include/ad.hpp b/include/ad.hpp index 30ad3dc..eb38127 100644 --- a/include/ad.hpp +++ b/include/ad.hpp @@ -35,6 +35,13 @@ original variable. #include #include "parallel.hpp" //#include "linsolve.hpp" +// +#ifdef __INTEL_COMPILER +#define RESTRICT restrict +#else +#define RESTRICT __restrict__ +#endif + using namespace std; using namespace alg; @@ -859,12 +866,6 @@ void propagateAD(pVector& m0, pMatrix& cv0, System& sys, double aux, kurt; -#ifdef __INTEL_COMPILER -#define RESTRICT restrict -#else -#define RESTRICT __restrict__ -#endif - double * RESTRICT ptr_cv0 = cv0.get_datap(); double * RESTRICT ptr_cv_temp2 = cv_temp2.get_datap(); double * RESTRICT ptr_J = J.get_datap(); diff --git a/include/alg.hpp b/include/alg.hpp index cba3e02..8f9f185 100644 --- a/include/alg.hpp +++ b/include/alg.hpp @@ -13,6 +13,12 @@ #include // std::vector #include "tensor.hpp" +#ifdef __INTEL_COMPILER +#define RESTRICT restrict +#else +#define RESTRICT __restrict__ +#endif + namespace alg { // First, second and third order AD datatype @@ -108,7 +114,7 @@ template class pVector { private: size_t n; - T* data = NULL; + T* RESTRICT data = NULL; }; template inline size_t pVector::dim() const {