#include <iostream>
+#include <vector>
#include <stdlib.h>
#include <assert.h>
+using namespace std;
#include "cudaTools.h"
#include "Device.h"
#include "LimitsTools.h"
-using std::cout;
-using std::endl;
-
/*----------------------------------------------------------------------*\
|* Declaration *|
\*---------------------------------------------------------------------*/
|* Imported *|
\*-------------------------------------*/
-extern int mainCore();
+extern int mainCore(const vector<string>& args);
extern int mainTest();
/*--------------------------------------*\
|* Public *|
\*-------------------------------------*/
-int main(void);
+int main(int argc, char** argv);
/*--------------------------------------*\
|* Private *|
\*-------------------------------------*/
static void initCuda(int deviceId);
-static int start(void);
+static int start(const vector<string>& args);
/*----------------------------------------------------------------------*\
|* Implementation *|
|* Public *|
\*-------------------------------------*/
-int main(void)
+int main(int argc, char** argv)
{
cout << "main" << endl;
+ vector<string> args;
+ for (int i = 1; i < argc; ++i)
+ args.push_back(argv[i]);
+
// LimitsTools::rappelTypeSize();
if (Device::isCuda())
// 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.
// Device::loadCudaDriverAll();// Force driver to be load for all GPU
}
-int start(void)
+int start(const vector<string>& args)
{
Device::printCurrent();
- bool IS_TEST = false;
-
- if (IS_TEST)
- {
+ if (args.size() == 0 || args[0] == "tests")
+ {
return mainTest();
}
else
{
- return mainCore();
+ return mainCore(args);
}
}