Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
easea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Arnaud Kress
easea
Commits
25e1dc7c
Commit
25e1dc7c
authored
May 12, 2009
by
maitre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugged cuda mo version
parent
4b16bc6c
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2100 additions
and
8 deletions
+2100
-8
Easea.h
Easea.h
+1
-1
EaseaLex.l
EaseaLex.l
+29
-2
EaseaParse.y
EaseaParse.y
+10
-1
makefile
makefile
+3
-0
tpl/CUDA.tpl
tpl/CUDA.tpl
+2
-1
tpl/CUDA_MO.tpl
tpl/CUDA_MO.tpl
+2050
-0
tpl/STD.tpl
tpl/STD.tpl
+1
-1
tpl/STD_MO.tpl
tpl/STD_MO.tpl
+4
-2
No files found.
Easea.h
View file @
25e1dc7c
...
...
@@ -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
...
...
EaseaLex.l
View file @
25e1dc7c
...
...
@@ -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");
...
...
EaseaParse.y
View file @
25e1dc7c
...
...
@@ -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]=='"') {
...
...
makefile
View file @
25e1dc7c
...
...
@@ -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
...
...
tpl/CUDA.tpl
View file @
25e1dc7c
...
...
@@ -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++ )
...
...
tpl/CUDA_MO.tpl
0 → 100644
View file @
25e1dc7c
This diff is collapsed.
Click to expand it.
tpl/STD.tpl
View file @
25e1dc7c
...
...
@@ -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);
...
...
tpl/STD_MO.tpl
View file @
25e1dc7c
...
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment