Ajout des cas de tests pour les TP non-graphiques. Cleanage en tous genres.
[GPU.git] / WCudaMSE / Student_Cuda / src / cpp / core / mainCore.cpp
index ad144a1..12ba6fa 100755 (executable)
@@ -1,44 +1,35 @@
 #include <iostream>
 #include <stdlib.h>
+#include <algorithm>
+using namespace std;
 
+#include "01c_Saucisson/Saucisson.h"
+#include "02_ProduitScalaire/ProduitScalaire.h"
+#include "03_Histogramme/Histogramme.h"
+#include "04_MonteCarlo/MonteCarlo.h"
 
-using std::cout;
-using std::endl;
+extern bool useHello();
+extern bool addVectors();
 
-/*----------------------------------------------------------------------*\
- |*                    Declaration                                     *|
- \*---------------------------------------------------------------------*/
-
-/*--------------------------------------*\
- |*            Imported                *|
- \*-------------------------------------*/
-
-extern bool useHello(void);
-
-/*--------------------------------------*\
- |*            Public                  *|
- \*-------------------------------------*/
-
-int mainCore();
+int mainCore(const vector<string>& args)
+    {
+    bool isOk = true;
 
-/*--------------------------------------*\
- |*            Private                 *|
- \*-------------------------------------*/
+    // Exemples simples.
+    //isOk &= useHello();
+    //isOk &= addVectors();
 
+    if (find(args.begin(), args.end(), "saucisson") != args.end())
+        isOk &= saucisson();
 
+    if (find(args.begin(), args.end(), "produit-scalaire") != args.end())
+        isOk &= produitScalaire();
 
-/*----------------------------------------------------------------------*\
- |*                    Implementation                                  *|
- \*---------------------------------------------------------------------*/
+    if (find(args.begin(), args.end(), "histogramme") != args.end())
+        isOk &= histogramme();
 
-/*--------------------------------------*\
- |*            Public                  *|
- \*-------------------------------------*/
-
-int mainCore()
-    {
-    bool isOk = true;
-    isOk &= useHello();
+    if (find(args.begin(), args.end(), "monte-carlo") != args.end())
+        isOk &= monteCarlo();
 
     cout << "\nisOK = " << isOk << endl;
     cout << "\nEnd : mainCore" << endl;
@@ -46,13 +37,3 @@ int mainCore()
     return isOk ? EXIT_SUCCESS : EXIT_FAILURE;
     }
 
-/*--------------------------------------*\
- |*            Private                 *|
- \*-------------------------------------*/
-
-
-
-/*----------------------------------------------------------------------*\
- |*                    End                                             *|
- \*---------------------------------------------------------------------*/
-