Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

Commit 0093d042 authored by Frederic's avatar Frederic
Browse files

CMAES-gpu

parent 7711f217
...@@ -29,6 +29,7 @@ Centre de Math ...@@ -29,6 +29,7 @@ Centre de Math
#define STD_FLAVOR_CMAES 2 #define STD_FLAVOR_CMAES 2
#define CUDA_FLAVOR_SO 0 #define CUDA_FLAVOR_SO 0
#define CUDA_FLAVOR_MO 1 #define CUDA_FLAVOR_MO 1
#define CUDA_FLAVOR_CMAES 2
#define UNIX 1 #define UNIX 1
#define WINDOWS 2 #define WINDOWS 2
......
...@@ -2161,6 +2161,8 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable) ...@@ -2161,6 +2161,8 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
if (TARGET==CUDA){ if (TARGET==CUDA){
if(TARGET_FLAVOR == CUDA_FLAVOR_SO ) if(TARGET_FLAVOR == CUDA_FLAVOR_SO )
strcat(sTemp,"CUDA.tpl"); strcat(sTemp,"CUDA.tpl");
else if(TARGET_FLAVOR == CUDA_FLAVOR_CMAES )
strcat(sTemp,"CMAES_CUDA.tpl");
else else
strcat(sTemp,"CUDA_MO.tpl"); strcat(sTemp,"CUDA_MO.tpl");
......
...@@ -355,7 +355,7 @@ Object ...@@ -355,7 +355,7 @@ Object
if (bVERBOSE) printf(" %s pointer declared (%d bytes)\n",$2->sName,$2->nSize); if (bVERBOSE) printf(" %s pointer declared (%d bytes)\n",$2->sName,$2->nSize);
} }
| Symbol '[' Expr ']' { | Symbol '[' Expr ']' {
if((TARGET_FLAVOR==STD_FLAVOR_CMAES) && nPROBLEM_DIM==0 && strcmp(pCURRENT_CLASS->sName,"Genome")==0) { nGENOME_NAME=$1->sName; nPROBLEM_DIM=(int)$3;} if((TARGET_FLAVOR==STD_FLAVOR_CMAES || TARGET_FLAVOR==CUDA_FLAVOR_CMAES) && nPROBLEM_DIM==0 && strcmp(pCURRENT_CLASS->sName,"Genome")==0) { nGENOME_NAME=$1->sName; nPROBLEM_DIM=(int)$3;}
$1->nSize=pCURRENT_TYPE->nSize*(int)$3; $1->nSize=pCURRENT_TYPE->nSize*(int)$3;
$1->pClass=pCURRENT_CLASS; $1->pClass=pCURRENT_CLASS;
$1->pType=pCURRENT_TYPE; $1->pType=pCURRENT_TYPE;
...@@ -1382,6 +1382,10 @@ int main(int argc, char *argv[]){ ...@@ -1382,6 +1382,10 @@ int main(int argc, char *argv[]){
TARGET=STD; TARGET=STD;
TARGET_FLAVOR = STD_FLAVOR_CMAES; TARGET_FLAVOR = STD_FLAVOR_CMAES;
} }
else if (!mystricmp(sTemp,"cmaes_cuda")) {
TARGET=CUDA;
TARGET_FLAVOR = CUDA_FLAVOR_CMAES;
}
else if (!mystricmp(sTemp,"v")) bVERBOSE=true; else if (!mystricmp(sTemp,"v")) bVERBOSE=true;
else if (!mystricmp(sTemp,"path")) { else if (!mystricmp(sTemp,"path")) {
......
...@@ -1033,9 +1033,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){ ...@@ -1033,9 +1033,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
for(size_t i=0; i<population->parentPopulationSize; i++){ for(size_t i=0; i<population->parentPopulationSize; i++){
currentAverageFitness+=population->parents[i]->getFitness(); currentAverageFitness+=population->parents[i]->getFitness();
#if \MINIMAXI #if \MINIMAXI
if(population->parents[i]->getFitness()>population->Best->getFitness())
#else
if(population->parents[i]->getFitness()<population->Best->getFitness()) if(population->parents[i]->getFitness()<population->Best->getFitness())
#else
if(population->parents[i]->getFitness()>population->Best->getFitness())
#endif #endif
population->Best=population->parents[i]; population->Best=population->parents[i];
} }
......
...@@ -547,9 +547,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){ ...@@ -547,9 +547,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
for(size_t i=0; i<population->parentPopulationSize; i++){ for(size_t i=0; i<population->parentPopulationSize; i++){
currentAverageFitness+=population->parents[i]->getFitness(); currentAverageFitness+=population->parents[i]->getFitness();
#if \MINIMAXI #if \MINIMAXI
if(population->parents[i]->getFitness()>population->Best->getFitness())
#else
if(population->parents[i]->getFitness()<population->Best->getFitness()) if(population->parents[i]->getFitness()<population->Best->getFitness())
#else
if(population->parents[i]->getFitness()>population->Best->getFitness())
#endif #endif
population->Best=population->parents[i]; population->Best=population->parents[i];
} }
......
...@@ -572,9 +572,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){ ...@@ -572,9 +572,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
for(size_t i=0; i<population->parentPopulationSize; i++){ for(size_t i=0; i<population->parentPopulationSize; i++){
currentAverageFitness+=population->parents[i]->getFitness(); currentAverageFitness+=population->parents[i]->getFitness();
#if \MINIMAXI #if \MINIMAXI
if(population->parents[i]->getFitness()>population->Best->getFitness())
#else
if(population->parents[i]->getFitness()<population->Best->getFitness()) if(population->parents[i]->getFitness()<population->Best->getFitness())
#else
if(population->parents[i]->getFitness()>population->Best->getFitness())
#endif #endif
population->Best=population->parents[i]; population->Best=population->parents[i];
} }
......
...@@ -334,9 +334,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){ ...@@ -334,9 +334,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
for(size_t i=0; i<population->parentPopulationSize; i++){ for(size_t i=0; i<population->parentPopulationSize; i++){
currentAverageFitness+=population->parents[i]->getFitness(); currentAverageFitness+=population->parents[i]->getFitness();
#if \MINIMAXI #if \MINIMAXI
if(population->parents[i]->getFitness()>population->Best->getFitness())
#else
if(population->parents[i]->getFitness()<population->Best->getFitness()) if(population->parents[i]->getFitness()<population->Best->getFitness())
#else
if(population->parents[i]->getFitness()>population->Best->getFitness())
#endif #endif
population->Best=population->parents[i]; population->Best=population->parents[i];
} }
......
...@@ -307,9 +307,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){ ...@@ -307,9 +307,9 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
for(size_t i=0; i<population->parentPopulationSize; i++){ for(size_t i=0; i<population->parentPopulationSize; i++){
currentAverageFitness+=population->parents[i]->getFitness(); currentAverageFitness+=population->parents[i]->getFitness();
#if \MINIMAXI #if \MINIMAXI
if(population->parents[i]->getFitness()>population->Best->getFitness())
#else
if(population->parents[i]->getFitness()<population->Best->getFitness()) if(population->parents[i]->getFitness()<population->Best->getFitness())
#else
if(population->parents[i]->getFitness()>population->Best->getFitness())
#endif #endif
population->Best=population->parents[i]; population->Best=population->parents[i];
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment