added new implimentation of private arrays

This commit is contained in:
ALEXks
2024-10-29 11:53:41 +03:00
committed by Mikhail Kocharmin
parent 2b9301e3a0
commit dc18a17e5a
12 changed files with 945 additions and 113 deletions

View File

@@ -261,6 +261,10 @@ const int END_OF_USE_LIST = 1050; /*ACC*/
const int END_OF_USE_LIST = 1050; /*ACC*/
const int ROUTINE_ATTR = 1051; /*ACC*/
const int DATA_REGION_SYMB = 1052; /*ACC*/
const int REMOTE_ACCESS_BUF = 1053; /*ACC*/
const int L_BOUNDS = 1054; /*ACC*/
const int DIM_SIZES = 1055; /*ACC*/
const int PRIVATE_ARRAY = 1056; /*ACC*/
const int PRIVATE_POINTER = 1057; /*ACC*/
const int MAX_LOOP_LEVEL = 20; // 7 - maximal number of loops in parallel loop nest
@@ -1275,6 +1279,7 @@ SgSymbol *isSameRedVar(char *name);
SgSymbol *isSameRedVar(char *name);
SgSymbol *isSameArray(char *name);
SgSymbol *isSameIndexVar(char *name);
SgType * C_LongLongType();
SgType * C_UnsignedLongLongType();
SgType * C_DvmType();
SgType * C_CudaIndexType();
@@ -1434,6 +1439,18 @@ SgSymbol *HeaderSymbolForHandler(SgSymbol *ar);
SgSymbol *HeaderSymbolForHandler(SgSymbol *ar);
void TestRoutineAttribute(SgSymbol *s, SgStatement *routine_interface);
int LookForRoutineDir(SgStatement *interfaceFunc);
SgStatement *Interface(SgSymbol *s);
SgExpression *sizeOfElementInBytes(SgSymbol *symb);
SgExpression *sizeOfPrivateArraysInBytes();
SgExpression *ProductOfDimSizeArgs(SgExpression *esizes);
//void doPrivateArrayList(SgExpression *private_arrays, SgStatement *st_hedr);
void addPrivateArrayList(SgFunctionCallExp *fcall, SgExpression *private_arrays, SgStatement *st_hedr);
int TestArrayShape(SgSymbol *ar);
SgExpression *DimSizeListOfPrivateArrays();
SgExpression *BoundListOfPrivateArrays();
SgExpression * DummyListForPrivateArrays(SgStatement *st_hedr);
SgExpression *CreatePrivateDummyList();
char *PointerNameForPrivateArray(SgSymbol *symb);
void GetMemoryForPrivateArrays(SgSymbol *private_first, SgSymbol *s_loop_ref, int nump, SgStatement *st_end, SgStatement *st_hedr, SgExpression *e_totalThreads);
/* acc_analyzer.cpp */
@@ -1900,6 +1917,10 @@ SgStatement *Consistent_H (int il, SgExpression *hedr, SgExpression *axis_list);
SgStatement *Consistent_H (int il, SgExpression *hedr, SgExpression *axis_list);
SgStatement *LoopRemoteAccess_H (int il, SgExpression *hedr, SgSymbol *ar, SgExpression *axis_list);
SgStatement *RemoteAccess_H2 (SgExpression *buf_hedr, SgSymbol *ar, SgExpression *ar_hedr, SgExpression *axis_list);
SgStatement *GetRemoteBuf (SgSymbol *loop_s, int n, SgSymbol *s_buf_head);
SgExpression *GetDeviceProp(SgSymbol *s_loop_ref, SgExpression *ep);
SgExpression *GetMaxBlocks(SgSymbol *s_loop_ref, SgSymbol *s_max_blocks, SgSymbol *s_needed_bytes);
SgExpression *GetPrivateArray(SgSymbol *s_loop_ref, SgExpression *e_bytes);
SgExpression *DisposePrivateArray(SgSymbol *s_loop_ref, SgSymbol *s_array);
/* io.cpp */
@@ -2089,7 +2110,6 @@ char *Check_Correct_Name(const char *name);
/* acc_f2c.cpp */
void Translate_Fortran_To_C(SgStatement *stat, SgStatement *last, std::vector <std::stack <SgStatement*> > &, int);
SgStatement* Translate_Fortran_To_C(SgStatement* Stmt, bool isSapforConv = false);
SgStatement* Translate_Fortran_To_C(SgStatement* Stmt, bool isSapforConv = false);
SgSymbol* createNewFunctionSymbol(const char *name);
void swapDimentionsInprivateList(void);
@@ -2103,6 +2123,9 @@ void RenamingNewProcedureVariables(SgSymbol *proc_name);
void RenamingNewProcedureVariables(SgSymbol *proc_name);
SgSymbol *hasSameNameAsSource(SgSymbol *symb);
void RenamingCudaFunctionVariables(SgStatement *first, SgSymbol *k_symb, int replace_flag);
void replaceVariableSymbSameNameInStatements(SgStatement *first, SgStatement *last, SgSymbol *symb, SgSymbol *s_new, int replace_flag);
void RenamingCalledProcedureSymbols(SgStatement *header, SgStatement *copy_header);
void RenamingCalledProcedureSymbolsInKernel(SgSymbol *first_symb);
/* acc_across.cpp */
ArgsForKernel *Create_C_Adapter_Function_Across(SgSymbol *sadapter);
@@ -2238,7 +2261,7 @@ void ConvertLoopWithLabelToEnddoLoop (SgStatement *stat); /*OMP*/
// options on FDVM converter
enum OPTIONS {
AUTO_TFM = 0, ONE_THREAD, SPEED_TEST_L0, SPEED_TEST_L1, GPU_O0, GPU_O1, RTC, C_CUDA, OPT_EXP_COMP,
O_HOST, NO_CUDA, NO_BL_INFO, LOOP_ANALYSIS, PRIVATE_ANALYSIS, IO_RTS, READ_ALL, NO_REMOTE, NO_PURE_FUNC,
O_HOST, NO_CUDA, NO_BL_INFO, LOOP_ANALYSIS, PRIVATE_ANALYSIS, IO_RTS, READ_ALL, NO_REMOTE, NO_PURE_FUNC,
GPU_IRR_ACC, O_PL, O_PL2, BIG_P, NUM_OPT};
// ONE_THREAD - compile one thread CUDA-kernels only for across (TODO for all CUDA-kernels)
// SPEED_TEST_L0, SPEED_TEST_L1 - debug options for speed testof CUDA-kernels for across