Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 42b428dc authored by Farzad Sehat's avatar Farzad Sehat
Browse files

Ajout d'une nouvelle section User CUDA, afin de pouvoir utiliser des données...

Ajout d'une nouvelle section User CUDA, afin de pouvoir utiliser des données dans les thread GPU. Les initialisations CUDA se font dans cette section et les données sont ainsi accessibles à l'intérieur des threads GPU
parent 4477fcdb
This diff is collapsed.
......@@ -16,33 +16,34 @@
#define MACRO_IDENTIFIER 6
#define MACRO_DEFINITION 8
#define COPY_USER_DECLARATIONS 10
#define COPY_INITIALISATION_FUNCTION 12
#define ANALYSE_USER_CLASSES 14
#define COPY_EO_INITIALISER 16
#define COPY_GP_OPCODE 18
#define COPY 20
#define COPY_INITIALISER 22
#define COPY_CROSSOVER 24
#define COPY_MUTATOR 26
#define COPY_EVALUATOR 28
#define COPY_OPTIMISER 30
#define COPY_FINALIZATION_FUNCTION 32
#define COPY_DISPLAY 34
#define COPY_USER_FUNCTION 36
#define COPY_USER_GENERATION 38
#define PARAMETERS_ANALYSIS 40
#define GET_PARAMETERS 42
#define COPY_USER_FUNCTIONS 44
#define COPY_GENERATION_FUNCTION_BEFORE_REPLACEMENT 46
#define GET_METHODS 48
#define COPY_MAKEFILE_OPTION 50
#define COPY_BOUND_CHECKING_FUNCTION 52
#define COPY_BEG_GENERATION_FUNCTION 54
#define COPY_END_GENERATION_FUNCTION 56
#define COPY_INSTEAD_EVAL 58
#define GP_RULE_ANALYSIS 60
#define GP_COPY_OPCODE_CODE 62
#define COPY_GP_EVAL 64
#define COPY_USER_CUDA 12
#define COPY_INITIALISATION_FUNCTION 14
#define ANALYSE_USER_CLASSES 16
#define COPY_EO_INITIALISER 18
#define COPY_GP_OPCODE 20
#define COPY 22
#define COPY_INITIALISER 24
#define COPY_CROSSOVER 26
#define COPY_MUTATOR 28
#define COPY_EVALUATOR 30
#define COPY_OPTIMISER 32
#define COPY_FINALIZATION_FUNCTION 34
#define COPY_DISPLAY 36
#define COPY_USER_FUNCTION 38
#define COPY_USER_GENERATION 40
#define PARAMETERS_ANALYSIS 42
#define GET_PARAMETERS 44
#define COPY_USER_FUNCTIONS 46
#define COPY_GENERATION_FUNCTION_BEFORE_REPLACEMENT 48
#define GET_METHODS 50
#define COPY_MAKEFILE_OPTION 52
#define COPY_BOUND_CHECKING_FUNCTION 54
#define COPY_BEG_GENERATION_FUNCTION 56
#define COPY_END_GENERATION_FUNCTION 58
#define COPY_INSTEAD_EVAL 60
#define GP_RULE_ANALYSIS 62
#define GP_COPY_OPCODE_CODE 64
#define COPY_GP_EVAL 66
/////////////////////////////////////////////////////////////////////////////
// CEASEALexer
......@@ -86,7 +87,7 @@ public:
int yywrap();
double myStrtod() const;
#line 90 "EaseaLex.h"
#line 91 "EaseaLex.h"
};
#ifndef YYLEXNAME
......
......@@ -72,7 +72,7 @@ Centre de Math�matiques Appliqu�es
}
%start GENOME_ANALYSIS TEMPLATE_ANALYSIS MACRO_IDENTIFIER MACRO_DEFINITION
%start COPY_USER_DECLARATIONS COPY_INITIALISATION_FUNCTION ANALYSE_USER_CLASSES
%start COPY_USER_DECLARATIONS COPY_USER_CUDA COPY_INITIALISATION_FUNCTION ANALYSE_USER_CLASSES
%start COPY_EO_INITIALISER COPY_GP_OPCODE
%start COPY COPY_INITIALISER COPY_CROSSOVER COPY_MUTATOR COPY_EVALUATOR COPY_OPTIMISER COPY_FINALIZATION_FUNCTION
%start COPY_DISPLAY COPY_USER_FUNCTION COPY_USER_GENERATION PARAMETERS_ANALYSIS GET_PARAMETERS
......@@ -169,6 +169,15 @@ exponent ([Ee][+-]?[0-9]+)
lineCounter=1;
BEGIN COPY_USER_DECLARATIONS;
}
<TEMPLATE_ANALYSIS>"\\INSERT_USER_CUDA" {
if (bVERBOSE) printf ("Inserting user cuda.\n");
yyreset();
yyin = fpGenomeFile; // switch to .ez file and analyser
lineCounter=1;
BEGIN COPY_USER_CUDA;
}
<TEMPLATE_ANALYSIS>"\\INSERT_INITIALISATION_FUNCTION" {
if (bVERBOSE) printf ("Inserting initialisation function.\n");
yyreset();
......@@ -1306,6 +1315,25 @@ if(OPERATING_SYSTEM=WINDOWS)
<COPY_USER_DECLARATIONS>. {}
<COPY_USER_DECLARATIONS>\n {
lineCounter++;
}
<COPY_USER_CUDA>"\\User"[ \t\n]+"CUDA"[ \t\n]*":" {
fprintf (fpOutputFile,"// User CUDA\n");
if( bLINE_NUM_EZ_FILE )
fprintf(fpOutputFile,"#line %d \"%s.ez\"\n",lineCounter, sRAW_PROJECT_NAME);
BEGIN COPY;
}
<COPY_USER_CUDA><<EOF>> {
if (bVERBOSE) printf("*** No user CUDA were found. ***\n");
rewind(fpGenomeFile);
yyin = fpTemplateFile;
BEGIN TEMPLATE_ANALYSIS;
bNotFinishedYet=1;
}
<COPY_USER_CUDA>. {}
<COPY_USER_CUDA>\n {
lineCounter++;
}
<COPY_USER_FUNCTIONS>"\\User"[ \t\n]+"functions"[ \t\n]*":" {
......
......@@ -178,6 +178,11 @@ void* gpuThreadMain(void* arg){
cudaSetDevice(localArg->threadId);
int nbr_cudaPreliminaryProcess = 2;
// Because of the context of each GPU thread, we have to put all user's CUDA
// initialisation here if we want to use them in the GPU, otherwise they are
// not found in the GPU context
\INSERT_USER_CUDA
// Wait for population to evaluate
while(1){
sem_wait(&localArg->sem_in);
......
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