Commit 25e1dc7c authored by maitre's avatar maitre

Bugged cuda mo version

parent 4b16bc6c
......@@ -27,7 +27,7 @@ Centre de Math
#define STD_FLAVOR_SO 0
#define STD_FLAVOR_MO 1
#define CUDA_FLAVOR_SO 0
#define CUDA_FLAVOR_MO 0
#define CUDA_FLAVOR_MO 1
#define UNIX 1
#define WINDOWS 2
......
......@@ -867,6 +867,11 @@ exponent ([Ee][+-]?[0-9]+)
// create a symbolic link from Makefile to EASEA.mak
symlink(sFullFileName,sPathName);
}
else{
DEBUG_PRT("file name : %s",sFileName);
if( symlink(sFileName,"Makefile") ) perror("Symlink creation error ");
}
if (bVERBOSE){
printf("Creating %s...\n",sFileName);
......@@ -1554,6 +1559,24 @@ exponent ([Ee][+-]?[0-9]+)
<COPY_USER_FUNCTION>"GenomeClass" {if (TARGET==EO) fprintf(fpOutputFile, "GenotypeT");
else fprintf(fpOutputFile,"Genome.");
}
<COPY_USER_FUNCTION>"f1" {
if( bWithinCUDA_Evaluator && TARGET==CUDA && TARGET_FLAVOR==CUDA_FLAVOR_MO ){
fprintf(fpOutputFile,"(f[0])");
}
else
fprintf(fpOutputFile,"%s",yytext);
}
<COPY_USER_FUNCTION>"f2" {
if( bWithinCUDA_Evaluator && TARGET==CUDA && TARGET_FLAVOR==CUDA_FLAVOR_MO ){
fprintf(fpOutputFile,"(f[1])");
}
else
fprintf(fpOutputFile,"%s",yytext);
}
<COPY_USER_FUNCTION>"Genome" {
if (bWithinDisplayFunction) fprintf(fpOutputFile,"(*this)");
else if ((TARGET==EO)&&(bWithinInitialiser)) fprintf(fpOutputFile, "(*genome)");
......@@ -1661,7 +1684,7 @@ exponent ([Ee][+-]?[0-9]+)
<COPY_USER_FUNCTION>"\\end" {rewind(fpGenomeFile);
yyin = fpTemplateFile;
BEGIN TEMPLATE_ANALYSIS;
bWithinInitialiser=bWithinXover=bWithinMutator=bWithinEvaluator=0;
bWithinInitialiser=bWithinXover=bWithinMutator=bWithinEvaluator=bWithinCUDA_Evaluator=0;
if (bWithinDisplayFunction){
bWithinDisplayFunction=0; // display function
}
......@@ -1850,7 +1873,11 @@ int CEASEALexer::create(CEASEAParser* pParser, CSymbolTable* pSymTable)
} }
if (TARGET==CUDA){
strcat(sTemp,"CUDA.tpl");
if(TARGET_FLAVOR == CUDA_FLAVOR_SO )
strcat(sTemp,"CUDA.tpl");
else
strcat(sTemp,"CUDA_MO.tpl");
if (!(yyin = fpTemplateFile = fopen(sTemp, "r"))){
fprintf(stderr,"\n*** Could not open %s.\n",sTemp);
fprintf(stderr,"*** Please modify the EZ_PATH environment variable.\n");
......
......@@ -1326,7 +1326,15 @@ int main(int argc, char *argv[]){
if (!mystricmp(sTemp,"eo")) TARGET=EO;
else if (!mystricmp(sTemp,"galib")) TARGET=GALIB;
else if (!mystricmp(sTemp,"dream")) TARGET=DREAM;
else if (!mystricmp(sTemp,"cuda")) TARGET=CUDA;
else if (!mystricmp(sTemp,"cuda")){
TARGET=CUDA;
TARGET_FLAVOR = CUDA_FLAVOR_SO;
}
else if( !mystricmp(sTemp,"cuda_mo") ){
TARGET=CUDA;
TARGET_FLAVOR = CUDA_FLAVOR_MO;
}
else if (!mystricmp(sTemp,"std")) {
TARGET=STD;
TARGET_FLAVOR = STD_FLAVOR_SO;
......@@ -1335,6 +1343,7 @@ int main(int argc, char *argv[]){
TARGET=STD;
TARGET_FLAVOR = STD_FLAVOR_MO;
}
else if (!mystricmp(sTemp,"v")) bVERBOSE=true;
else if (!mystricmp(sTemp,"path")) {
if (argv[++nParamNb][0]=='"') {
......
......@@ -60,6 +60,9 @@ clean:
rm -f *.o $(EXEC) $(EXEC)_bin
cd alexyacc && make clean
install:$(EXEC)
sudo cp $< /usr/bin/easea
# realclean: clean
# rm -f EaseaParse.cpp EaseaParse.h EaseaLex.cpp EaseaLex.h
......
......@@ -82,7 +82,7 @@ struct gpuOptions initOpts;
\INSERT_INITIALISATION_FUNCTION
\INSERT_FINALIZATION_FUNCTION
\INSERT_GENERATION_FUNCTION
\INSERT_BOUND_CHECKING
......@@ -538,6 +538,7 @@ void EvolutionaryAlgorithm::runEvolutionaryLoop(){
population->produceOffspringPopulation();
\INSERT_BOUND_CHECKING_FCT_CALL
TIME_ST(eval);
for( size_t i=0 ; i<this->population->actualOffspringPopulationSize ; i++ )
......
This diff is collapsed.
......@@ -318,7 +318,7 @@ void EvolutionaryAlgorithm::showPopulationStats(struct timeval beginTime){
if(currentGeneration==0)
printf("GEN\tTIME\t\tEVAL\tBEST\t\tAVG\t\tSTDEV\n\n");
assert( currentSTDEV == currentSTDEV );
// assert( currentSTDEV == currentSTDEV );
struct timeval end, res;
gettimeofday(&end,0);
......
......@@ -279,10 +279,12 @@ void EvolutionaryAlgorithm::runEvolutionaryLoop(){
\INSERT_GEN_FCT_CALL
showPopulationStats(begin);
showPopulationStats(begin);
currentGeneration += 1;
}
population->sortParentPopulation();
std::cout << *population->parents[0] << std::endl;
std::cout << *population << std::endl;
std::cout << "Generation : " << currentGeneration << std::endl;
......@@ -1690,7 +1692,7 @@ $(BIN):$(OBJ)
$(CXX) $^ -o $@ $(LDFLAGS)
easeaclean: clean
rm -f Makefile $(SRC) $(HDR) EASEA.mak
rm -f Makefile $(SRC) $(HDR) EASEA.mak EASEA.prm
clean:
rm -f $(OBJ) $(BIN)
......
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