Index: Pi/XPU/PiXPU.py
===================================================================
--- Pi/XPU/PiXPU.py	(revision 180)
+++ Pi/XPU/PiXPU.py	(revision 181)
@@ -71,7 +71,8 @@
 def DictionariesAPI():
     Marsaglia={'CONG':0,'SHR3':1,'MWC':2,'KISS':3}
     Computing={'INT32':0,'INT64':1,'FP32':2,'FP64':3}
-    return(Marsaglia,Computing)
+    Test={True:1,False:0}
+    return(Marsaglia,Computing,Test)
     
 # find prime factors of a number
 # Get for WWW :
@@ -128,6 +129,8 @@
 #define TFP32 2
 #define TFP64 3
 
+#define IFTHEN 1
+
 // Marsaglia RNG very simple implementation
 
 #define znew  ((z=36969*(z&65535)+(z>>16))<<16)
@@ -225,8 +228,14 @@
     #endif
 #endif
 
+#if TEST == IFTHEN
+      if ((x*x+y*y) <=THEONE) {
+         total+=1;
+      }
+#else
       ulong inside=((x*x+y*y) <= THEONE) ? 1:0;
       total+=inside;
+#endif
    }
 
    return(total);
@@ -270,6 +279,8 @@
 #define TFP32 2
 #define TFP64 3
 
+#define IFTHEN 1
+
 // Marsaglia RNG very simple implementation
 #define znew  ((z=36969*(z&65535)+(z>>16))<<16)
 #define wnew  ((w=18000*(w&65535)+(w>>16))&65535)
@@ -368,8 +379,14 @@
     #endif
 #endif
 
+#if TEST == IFTHEN
+      if ((x*x+y*y) <= THEONE) {
+         total+=1;
+      }
+#else
       ulong inside=((x*x+y*y) <= THEONE) ? 1:0;
       total+=inside;
+#endif
    }
    
    return(total);
@@ -410,8 +427,9 @@
     Device=InputCU['Device']
     RNG=InputCU['RNG']
     ValueType=InputCU['ValueType']
+    TestType=InputCU['IfThen']
     
-    Marsaglia,Computing=DictionariesAPI()
+    Marsaglia,Computing,Test=DictionariesAPI()
     
     try:
         # For PyCUDA import
@@ -439,7 +457,7 @@
         #mod = SourceModule(KernelCodeCuda(),options=['--compiler-options','-DTRNG=%i -DTYPE=%s' % (Marsaglia[RNG],Computing[ValueType])])
         #mod = SourceModule(KernelCodeCuda(),nvcc='nvcc',keep=True)
         # Needed to set the compiler via ccbin for CUDA9 implementation
-        mod = SourceModule(KernelCodeCuda(),options=['-ccbin','clang-3.8','--compiler-options','-DTRNG=%i' % Marsaglia[RNG],'-DTYPE=%s' % Computing[ValueType]],keep=True)
+        mod = SourceModule(KernelCodeCuda(),options=['-ccbin','clang-3.8','--compiler-options','-DTRNG=%i' % Marsaglia[RNG],'-DTYPE=%s' % Computing[ValueType],'-DTEST=%s' % Test[TestType]],keep=True)
     except:
         print("Compilation seems to break")
  
@@ -490,11 +508,12 @@
     blocks=InputCL['Blocks']
     threads=InputCL['Threads']
     Device=InputCL['Device']
-    RNG=InputCL['RNG']
+    RNG=InputCL['RNG']  
     ValueType=InputCL['ValueType']
+    TestType=InputCL['IfThen']
+
+    Marsaglia,Computing,Test=DictionariesAPI()
     
-    Marsaglia,Computing=DictionariesAPI()
-    
     # Initialisation des variables en les CASTant correctement
     Id=0
     HasXPU=False
@@ -523,7 +542,7 @@
     circle=numpy.zeros(blocks*threads).astype(numpy.uint64)
     circleCL = cl.Buffer(ctx, mf.WRITE_ONLY|mf.COPY_HOST_PTR,hostbuf=circle)
     
-    MetropolisCL = cl.Program(ctx,KernelCodeOpenCL()).build( options = "-cl-mad-enable -cl-fast-relaxed-math -DTRNG=%i -DTYPE=%s" % (Marsaglia[RNG],Computing[ValueType]))
+    MetropolisCL = cl.Program(ctx,KernelCodeOpenCL()).build( options = "-cl-mad-enable -cl-fast-relaxed-math -DTRNG=%i -DTYPE=%s -DTEST=%s" % (Marsaglia[RNG],Computing[ValueType],Test[TestType]))
 
     MyDuration=numpy.zeros(steps)
   
@@ -671,15 +690,17 @@
     Curves=False
     # Fit is True to print the curves
     Fit=False
+    # Inside based on If
+    IfThen=False
     # Marsaglia RNG
     RNG='MWC'
     # Value type : INT32, INT64, FP32, FP64
     ValueType='FP32'
 
-    HowToUse='%s -o (Out of Core Metrology) -c (Print Curves) -d <DeviceId> -g <CUDA/OpenCL> -i <Iterations> -b <BlocksBegin> -e <BlocksEnd> -s <BlocksStep> -f <ThreadsFirst> -l <ThreadsLast> -t <ThreadssTep> -r <RedoToImproveStats> -m <SHR3/CONG/MWC/KISS> -v <INT32/INT64/FP32/FP64>'
+    HowToUse='%s -o (Out of Core Metrology) -c (Print Curves) -k (Case On IfThen) -d <DeviceId> -g <CUDA/OpenCL> -i <Iterations> -b <BlocksBegin> -e <BlocksEnd> -s <BlocksStep> -f <ThreadsFirst> -l <ThreadsLast> -t <ThreadssTep> -r <RedoToImproveStats> -m <SHR3/CONG/MWC/KISS> -v <INT32/INT64/FP32/FP64>'
     
     try:
-        opts, args = getopt.getopt(sys.argv[1:],"hocg:i:b:e:s:f:l:t:r:d:m:v:",["gpustyle=","iterations=","blocksBegin=","blocksEnd=","blocksStep=","threadsFirst=","threadsLast=","threadssTep=","redo=","device=","marsaglia=","valuetype="])
+        opts, args = getopt.getopt(sys.argv[1:],"hockg:i:b:e:s:f:l:t:r:d:m:v:",["gpustyle=","iterations=","blocksBegin=","blocksEnd=","blocksStep=","threadsFirst=","threadsLast=","threadssTep=","redo=","device=","marsaglia=","valuetype="])
     except getopt.GetoptError:
         print(HowToUse % sys.argv[0])
         sys.exit(2)
@@ -727,6 +748,8 @@
             Metrology='OutMetro'
         elif opt == '-c':
             Curves=True
+        elif opt == '-k':
+            IfThen=True
         elif opt in ("-d", "--device"):
             Devices.append(int(arg))
         elif opt in ("-g", "--gpustyle"):
@@ -842,6 +865,7 @@
                         InputCU['Device']=Devices[0]
                         InputCU['RNG']=RNG
                         InputCU['ValueType']=ValueType                    
+                        InputCU['IfThen']=IfThen                    
                         OutputCU=MetropolisCuda(InputCU)
                         Inside=OutputCU['Circle']
                         NewIterations=OutputCU['NewIterations']
@@ -857,7 +881,8 @@
                         InputCL['Threads']=Threads
                         InputCL['Device']=Devices[0]
                         InputCL['RNG']=RNG
-                        InputCL['ValueType']=ValueType                    
+                        InputCL['ValueType']=ValueType
+                        InputCL['IfThen']=IfThen                    
                         OutputCL=MetropolisOpenCL(InputCL)
                         Inside=OutputCL['Circle']
                         NewIterations=OutputCL['NewIterations']
@@ -877,6 +902,7 @@
                     InputCU['Device']=Devices[0]
                     InputCU['RNG']=RNG
                     InputCU['ValueType']=ValueType
+                    InputCU['IfThen']=IfThen                    
                     OutputCU=MetropolisCuda(InputCU)
                     Inside=OutputCU['Inside']
                     NewIterations=OutputCU['NewIterations']
@@ -897,6 +923,7 @@
                     InputCL['Device']=Devices[0]
                     InputCL['RNG']=RNG
                     InputCL['ValueType']=ValueType
+                    InputCL['IfThen']=IfThen
                     OutputCL=MetropolisOpenCL(InputCL)
                     Inside=OutputCL['Inside']
                     NewIterations=OutputCL['NewIterations']
