X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fmain.cpp;h=5e56e8afe0bd692b20fdf4a35111307876446c21;hp=397a1330568a3a428ad8c50876ab28b6469f289b;hb=6664817ed89b0b616044da35a3eb8f715e0813d9;hpb=ee885ed84f2ff3d5fb1e7ac41fa3c8879314ee36 diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/main.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/main.cpp index 397a133..5e56e8a 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/main.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/main.cpp @@ -1,15 +1,14 @@ #include +#include #include #include +using namespace std; #include "cudaTools.h" #include "Device.h" #include "cudaTools.h" #include "GLUTImageViewers.h" -using std::cout; -using std::endl; - /*----------------------------------------------------------------------*\ |* Declaration *| \*---------------------------------------------------------------------*/ @@ -18,7 +17,7 @@ using std::endl; |* Imported *| \*-------------------------------------*/ -extern int mainGL(void); +extern int mainGL(const vector& args); extern int mainFreeGL(void); /*--------------------------------------*\ @@ -31,7 +30,7 @@ int main(int argc, char** argv); |* Private *| \*-------------------------------------*/ -static int start(void); +static int start(const vector& args); static void initCuda(int deviceId); /*----------------------------------------------------------------------*\ @@ -57,7 +56,11 @@ int main(int argc, char** argv) // Server Cuda2: in [0,2] int deviceId = 0; - int isOk = start(); + vector 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. @@ -84,7 +87,7 @@ void initCuda(int deviceId) // 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 @@ -95,7 +98,7 @@ void initCuda(int deviceId) // Device::loadCudaDriverAll();// Force driver to be load for all GPU } -int start(void) +int start(const vector& args) { Device::printCurrent(); @@ -103,7 +106,7 @@ int start(void) if (IS_GL) { - return mainGL(); // Bloquant, Tant qu'une fenetre est ouverte + return mainGL(args); // Bloquant, Tant qu'une fenetre est ouverte } else {