2 #include "00_pi_tools.h"
5 /*----------------------------------------------------------------------*\
7 \*---------------------------------------------------------------------*/
9 /*--------------------------------------*\
11 \*-------------------------------------*/
14 /*--------------------------------------*\
16 \*-------------------------------------*/
18 bool isPiOMPEntrelacerPromotionTab_Ok(int n
);
20 /*--------------------------------------*\
22 \*-------------------------------------*/
24 static double piOMPEntrelacerPromotionTab(int n
);
26 /*----------------------------------------------------------------------*\
28 \*---------------------------------------------------------------------*/
30 /*--------------------------------------*\
32 \*-------------------------------------*/
34 bool isPiOMPEntrelacerPromotionTab_Ok(int n
)
36 return isAlgoPI_OK(piOMPEntrelacerPromotionTab
, n
, "Pi OMP Entrelacer promotionTab");
39 /*--------------------------------------*\
41 \*-------------------------------------*/
44 * pattern cuda : excellent!
46 double piOMPEntrelacerPromotionTab(int n
)
48 const int NB_THREAD
= OmpTools::setAndGetNaturalGranularity();
50 double* tabSums
= new double[NB_THREAD
];
52 const double DX
= 1.0/(double)n
;
57 const int TID
= OmpTools::getTid();
63 tabSums
[TID
] += fpi(xs
);
70 for (int i
= 0; i
< NB_THREAD
; i
++)
78 /*----------------------------------------------------------------------*\
80 \*---------------------------------------------------------------------*/