From ee9fb52f070ce8355077bcf70f8c3fd13af2476b Mon Sep 17 00:00:00 2001 From: boufaras Date: Wed, 3 Aug 2011 09:43:06 +0000 Subject: [PATCH] review and update the documentation git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2347 331e1502-861f-0410-8da2-ba01fb791d7f --- .../tutoriel/OneMax/testFirstImpr.cu | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/branches/ParadisEO-GPU/tutoriel/OneMax/testFirstImpr.cu b/branches/ParadisEO-GPU/tutoriel/OneMax/testFirstImpr.cu index 5901d87f0..52c7b3b53 100644 --- a/branches/ParadisEO-GPU/tutoriel/OneMax/testFirstImpr.cu +++ b/branches/ParadisEO-GPU/tutoriel/OneMax/testFirstImpr.cu @@ -43,14 +43,15 @@ using namespace std; #include // OneMax full eval function #include -// OneMax increment eval function +//Parallel evaluation of neighborhood on GPU #include +// OneMax increment evaluation function #include // One Max solution #include -// One Max neighbor +// Bit neighbor #include -// One Max ordered neighborhood +// Ordered neighborhood #include // The Solution and neighbor comparator #include @@ -69,7 +70,7 @@ using namespace std; //------------------------------------------------------------------------------------ // Define types of the representation solution, different neighbors and neighborhoods //------------------------------------------------------------------------------------ -// REPRESENTATION + typedef moGPUBitVector solution; typedef moGPUBitNeighbor Neighbor; typedef moGPUOrderNeighborhoodByModif Neighborhood; @@ -93,16 +94,6 @@ void main_function(int argc, char **argv) parser.processParam( seedParam ); unsigned seed = seedParam.value(); - // description of genotype - eoValueParam vecSizeParam(1, "vecSize", "Genotype size", 'V'); - parser.processParam( vecSizeParam, "Representation" ); - unsigned vecSize = vecSizeParam.value(); - - //Number of position to change - eoValueParam nbPosParam(1, "nbPos", "X Change", 'N'); - parser.processParam( nbPosParam, "Exchange" ); - unsigned nbPos = nbPosParam.value(); - // the name of the "status" file where all actual parameter values will be saved string str_status = parser.ProgramName() + ".status"; // default value eoValueParam statusParam(str_status.c_str(), "status", "Status file"); @@ -135,7 +126,7 @@ void main_function(int argc, char **argv) * * ========================================================= */ - solution sol(vecSize); + solution sol(SIZE); /* ========================================================= * @@ -152,7 +143,7 @@ void main_function(int argc, char **argv) * ========================================================= */ OneMaxIncrEval incr_eval; - moGPUEvalByModif > cueval(vecSize,incr_eval); + moGPUEvalByModif > gpuEval(SIZE,incr_eval); /* ========================================================= * @@ -169,7 +160,7 @@ void main_function(int argc, char **argv) * * ========================================================= */ - Neighborhood neighborhood(vecSize,cueval); + Neighborhood neighborhood(SIZE,gpuEval); /* ========================================================= * @@ -177,7 +168,7 @@ void main_function(int argc, char **argv) * * ========================================================= */ - moFirstImprHCexplorer explorer(neighborhood, cueval, comparator, solComparator); + moFirstImprHCexplorer explorer(neighborhood, gpuEval, comparator, solComparator); /* ========================================================= @@ -197,7 +188,7 @@ void main_function(int argc, char **argv) * * ========================================================= */ - moFirstImprHC firstImprHC(neighborhood,eval,cueval); + moFirstImprHC firstImprHC(neighborhood,eval,gpuEval); /* ========================================================= * @@ -214,7 +205,7 @@ void main_function(int argc, char **argv) localSearch(sol); timer.stop(); std::cout << "final: " << sol << std::endl; - printf("CUDA execution time = %f ms\n",timer.getTime()); + printf("GPU execution time = %f ms\n",timer.getTime()); timer.deleteTimer(); /* ========================================================= @@ -223,7 +214,7 @@ void main_function(int argc, char **argv) * * ========================================================= */ - solution sol1(vecSize); + solution sol1(SIZE); eval(sol1); std::cout<< std::endl; std::cout << "initial: " << sol1<< std::endl;