#include <iostream>
+#include <vector>
#include <stdlib.h>
#include <assert.h>
+using namespace std;
#include "cudaTools.h"
#include "Device.h"
#include "cudaTools.h"
#include "GLUTImageViewers.h"
-using std::cout;
-using std::endl;
-
/*----------------------------------------------------------------------*\
|* Declaration *|
\*---------------------------------------------------------------------*/
|* Imported *|
\*-------------------------------------*/
-extern int mainGL(void);
+extern int mainGL(const vector<string>& args);
extern int mainFreeGL(void);
/*--------------------------------------*\
|* Private *|
\*-------------------------------------*/
-static int start(void);
+static int start(const vector<string>& args);
static void initCuda(int deviceId);
/*----------------------------------------------------------------------*\
// Server Cuda2: in [0,2]
int deviceId = 0;
- int isOk = start();
+ vector<string> args;
+ for (int i = 1; i < argc; ++i)
+ args.push_back(argv[i]);
+
+ int isOk = start(args);
//cudaDeviceReset causes the driver to clean up all state.
// While not mandatory in normal operation, it is good practice.
// Choose current device (state of host-thread)
HANDLE_ERROR(cudaSetDevice(deviceId));
- // Enable Interoperabilité OpenGL:
+ // Enable Interoperabilit� OpenGL:
// - Create a cuda specifique contexte, shared between Cuda and GL
// - To be called before first call to kernel
// - cudaSetDevice ou cudaGLSetGLDevice are mutualy exclusive
// Device::loadCudaDriverAll();// Force driver to be load for all GPU
}
-int start(void)
+int start(const vector<string>& args)
{
Device::printCurrent();
if (IS_GL)
{
- return mainGL(); // Bloquant, Tant qu'une fenetre est ouverte
+ return mainGL(args); // Bloquant, Tant qu'une fenetre est ouverte
}
else
{