5 #include "00_pi_tools.h"
8 /*----------------------------------------------------------------------*\
10 \*---------------------------------------------------------------------*/
12 /*--------------------------------------*\
14 \*-------------------------------------*/
17 /*--------------------------------------*\
19 \*-------------------------------------*/
21 bool isPiOMPEntrelacerPromotionTab_Ok(int n
);
23 /*--------------------------------------*\
25 \*-------------------------------------*/
27 static double piOMPEntrelacerPromotionTab(int n
);
29 /*----------------------------------------------------------------------*\
31 \*---------------------------------------------------------------------*/
33 /*--------------------------------------*\
35 \*-------------------------------------*/
37 bool isPiOMPEntrelacerPromotionTab_Ok(int n
)
39 return isAlgoPI_OK(piOMPEntrelacerPromotionTab
, n
, "Pi OMP Entrelacer promotionTab");
42 /*--------------------------------------*\
44 \*-------------------------------------*/
47 * pattern cuda : excellent!
49 double piOMPEntrelacerPromotionTab(int n
)
51 const int NB_THREAD
= OmpTools::setAndGetNaturalGranularity();
53 double* tabSums
= new double[NB_THREAD
];
54 memset(tabSums
, 0, NB_THREAD
* sizeof(double));
56 const double DX
= 1.0/(double)n
;
61 const int TID
= OmpTools::getTid();
67 tabSums
[TID
] += fpi(xs
);
74 for (int i
= 0; i
< NB_THREAD
; i
++)
82 /*----------------------------------------------------------------------*\
84 \*---------------------------------------------------------------------*/