projects
/
GPU.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ajout des cas de tests pour les TP non-graphiques. Cleanage en tous genres.
[GPU.git]
/
WCudaMSE
/
Student_Cuda
/
src
/
cpp
/
main.cpp
diff --git
a/WCudaMSE/Student_Cuda/src/cpp/main.cpp
b/WCudaMSE/Student_Cuda/src/cpp/main.cpp
index
ad4d735
..
7c3dc42
100755
(executable)
--- a/
WCudaMSE/Student_Cuda/src/cpp/main.cpp
+++ b/
WCudaMSE/Student_Cuda/src/cpp/main.cpp
@@
-1,13
+1,12
@@
#include <iostream>
#include <iostream>
+#include <vector>
#include <stdlib.h>
#include <assert.h>
#include <stdlib.h>
#include <assert.h>
+using namespace std;
#include "cudaTools.h"
#include "Device.h"
#include "cudaTools.h"
#include "Device.h"
-#include "LimitsTools.h"
-
-using std::cout;
-using std::endl;
+#include "LimitsTools.h"
/*----------------------------------------------------------------------*\
|* Declaration *|
/*----------------------------------------------------------------------*\
|* Declaration *|
@@
-17,21
+16,21
@@
using std::endl;
|* Imported *|
\*-------------------------------------*/
|* Imported *|
\*-------------------------------------*/
-extern int mainCore();
+extern int mainCore(
const vector<string>& args
);
extern int mainTest();
/*--------------------------------------*\
|* Public *|
\*-------------------------------------*/
extern int mainTest();
/*--------------------------------------*\
|* Public *|
\*-------------------------------------*/
-int main(
void
);
+int main(
int argc, char** argv
);
/*--------------------------------------*\
|* Private *|
\*-------------------------------------*/
static void initCuda(int deviceId);
/*--------------------------------------*\
|* Private *|
\*-------------------------------------*/
static void initCuda(int deviceId);
-static int start(
void
);
+static int start(
const vector<string>& args
);
/*----------------------------------------------------------------------*\
|* Implementation *|
/*----------------------------------------------------------------------*\
|* Implementation *|
@@
-41,22
+40,26
@@
static int start(void);
|* Public *|
\*-------------------------------------*/
|* Public *|
\*-------------------------------------*/
-int main(
void
)
+int main(
int argc, char** argv
)
{
cout << "main" << endl;
{
cout << "main" << endl;
+ vector<string> args;
+ for (int i = 1; i < argc; ++i)
+ args.push_back(argv[i]);
+
// LimitsTools::rappelTypeSize();
if (Device::isCuda())
{
// LimitsTools::rappelTypeSize();
if (Device::isCuda())
{
-
Device::printAll();
+ Device::printAll();
Device::printAllSimple();
// Server Cuda1: in [0,5]
// Server Cuda2: in [0,2]
int deviceId = 0;
Device::printAllSimple();
// Server Cuda1: in [0,5]
// Server Cuda2: in [0,2]
int deviceId = 0;
- int isOk = start();
+ int isOk = start(
args
);
//cudaDeviceReset causes the driver to clean up all state.
// While not mandatory in normal operation, it is good practice.
//cudaDeviceReset causes the driver to clean up all state.
// While not mandatory in normal operation, it is good practice.
@@
-86,19
+89,17
@@
void initCuda(int deviceId)
// Device::loadCudaDriverAll();// Force driver to be load for all GPU
}
// Device::loadCudaDriverAll();// Force driver to be load for all GPU
}
-int start(
void
)
+int start(
const vector<string>& args
)
{
Device::printCurrent();
{
Device::printCurrent();
- bool IS_TEST = false;
-
- if (IS_TEST)
- {
+ if (args.size() == 0 || args[0] == "tests")
+ {
return mainTest();
}
else
{
return mainTest();
}
else
{
- return mainCore();
+ return mainCore(
args
);
}
}
}
}