# Function which creates generic performance tests automatically # baseTargetName : base name of the target (for example hadamard_product) # optimsiationMode : mode of the optimisation (basic, vectorize, intrinsics) # valueType : type of the inserted value to be tested (nan, denorm) # optimisationFlag : flag of the optimsiation without vectorization (-O0, -O1, -O2, -O3, -Ofast) # functionName : name of the function to be used # valueNbNan : value to be put randomly for vector initialisation # defNanValue : definition of the exotic value to be used # vectorizeOption : option for the vectorization # configPerformance : configuration to be passed to the program to get performance restult for each point # ARGN : list of program sources function(generic_compileAndRunExample baseTargetName optimsiationMode valueType optimisationFlag functionName valueNbNan defNanValue vectorizeOption configPerformance) set(PROGRAM_SRC ${ARGN}) string(REPLACE "-" "" nameOptimisationFlag ${optimisationFlag}) set(baseProgramName "${baseTargetName}_${optimsiationMode}") if(NOT valueType STREQUAL "") set(baseProgramName "${baseProgramName}_${valueType}") endif() if(valueNbNan STREQUAL "") set(DEFINE_RATIO_NB_NAN "") else() string(REPLACE "." "" nameValueNbNan ${valueNbNan}) set(baseProgramName "${baseProgramName}_${nameValueNbNan}") set(DEFINE_RATIO_NB_NAN "-DRATIO_NB_NAN=${valueNbNan}") endif() set(targetName "${baseProgramName}_${nameOptimisationFlag}") if(defNanValue STREQUAL "") set(DEFINE_NAN_VALUE "") else() set(DEFINE_NAN_VALUE "-DVALUE_DEF=\"${defNanValue}\"") endif() set(FUNCTION_INCLUDE_DEF "-DINCLUDE_FUNCTION_NAME=\"\\\"${functionName}.h\\\"\"") set(FUNCTION_NAME_DEF "-DFUNCTION_NAME=${functionName}") set(FUNCTION_STR_NAME_DEF "-DKERNEL_STR_FUNCTION_NAME=\"\\\"${functionName}\\\"\"") phoenix_compileAndRunExample(${targetName} "${optimisationFlag} ${DEFINE_RATIO_NB_NAN} ${vectorizeOption} ${FUNCTION_INCLUDE_DEF} ${FUNCTION_NAME_DEF} ${FUNCTION_STR_NAME_DEF} ${DEFINE_NAN_VALUE}" "${configPerformance}" ${PROGRAM_SRC}) endfunction(generic_compileAndRunExample) # Function which creates multiple performance tests automatically # baseComparisonPlotName : base name of the comparison plot to be created (for example hadamardProductVectorizeNanO3) # baseTargetName : base name of the target (for example hadamard_product) # optimsiationMode : mode of the optimisation (basic, vectorize, intrinsics) # vectorizeOption : option for the vectorization # configPerformance : configuration to be passed to the program to get performance restult for each point # ARGN : list of program sources function(multiplePerfTest baseComparisonPlotName baseTargetName optimsiationMode vectorizeOption configPerformance) set(PROGRAM_SRC ${ARGN}) set(functionName "${baseTargetName}_${optimsiationMode}") if(vectorizeOption STREQUAL "") set(listOptimisationFlag -O0 -O1 -O2 -O3 -Ofast) else() set(listOptimisationFlag -O2 -O3 -Ofast) endif() set(listTargetPerf) foreach(optimisationFlag ${listOptimisationFlag}) string(REPLACE "-" "" nameOptimisationFlag ${optimisationFlag}) set(baseProgramName "${baseTargetName}_${optimsiationMode}_${nameOptimisationFlag}") generic_compileAndRunExample(${baseTargetName} ${optimsiationMode} "" "${optimisationFlag}" ${functionName} "" "" "${vectorizeOption}" "${configPerformance}" ${PROGRAM_SRC}) list(APPEND listTargetPerf ${baseProgramName}) endforeach(optimisationFlag) phoenix_plotPerf("${baseComparisonPlotName}" ${listTargetPerf}) endfunction(multiplePerfTest) # Function which creates multiple performance tests automatically # baseComparisonPlotName : base name of the comparison plot to be created (for example hadamardProductVectorizeNanO3) # baseTargetName : base name of the target (for example hadamard_product) # optimsiationMode : mode of the optimisation (basic, vectorize, intrinsics) # vectorizeOption : option for the vectorization # configPerformance : configuration to be passed to the program to get performance restult for each point # ARGN : list of program sources function(multiplePerfTestLogX baseComparisonPlotName baseTargetName optimsiationMode vectorizeOption configPerformance) set(PROGRAM_SRC ${ARGN}) set(functionName "${baseTargetName}_${optimsiationMode}") if(vectorizeOption STREQUAL "") set(listOptimisationFlag -O0 -O1 -O2 -O3 -Ofast) else() set(listOptimisationFlag -O2 -O3 -Ofast) endif() set(listTargetPerf) foreach(optimisationFlag ${listOptimisationFlag}) string(REPLACE "-" "" nameOptimisationFlag ${optimisationFlag}) set(baseProgramName "${baseTargetName}_${optimsiationMode}_${nameOptimisationFlag}") generic_compileAndRunExample(${baseTargetName} ${optimsiationMode} "" "${optimisationFlag}" ${functionName} "" "" "${vectorizeOption}" "${configPerformance}" ${PROGRAM_SRC}) list(APPEND listTargetPerf ${baseProgramName}) endforeach(optimisationFlag) phoenix_plotPerfLogX("${baseComparisonPlotName}" ${listTargetPerf}) endfunction(multiplePerfTestLogX) # Function which creates multiple performance tests automatically # baseComparisonPlotName : base name of the comparison plot to be created (for example hadamardProductVectorizeNanO3) # baseTargetName : base name of the target (for example hadamard_product) # optimsiationMode : mode of the optimisation (basic, vectorize, intrinsics) # valueType : type of the inserted value to be tested (nan, denorm) # optimisationFlag : flag of the optimsiation without vectorization (-O0, -O1, -O2, -O3, -Ofast) # defNanValue : definition of the exotic value to be used # vectorizeOption : option for the vectorization # configPerformance : configuration to be passed to the program to get performance restult for each point # ARGN : list of program sources function(multiplePerfTestValue baseComparisonPlotName baseTargetName optimsiationMode valueType optimisationFlag defNanValue vectorizeOption configPerformance) set(PROGRAM_SRC ${ARGN}) set(functionName "${baseTargetName}_${optimsiationMode}") string(REPLACE "-" "" nameOptimisationFlag ${optimisationFlag}) set(baseProgramName "${baseTargetName}_${optimsiationMode}_${valueType}") set(comparisonProgramName "${baseTargetName}_${optimsiationMode}_${nameOptimisationFlag}") set(listRatioNbNan 0.01 0.1 0.25 0.5 0.75 0.9 1) set(listTargetPerf) foreach(valueNbNan ${listRatioNbNan}) string(REPLACE "." "" nameValueNbNan ${valueNbNan}) set(tmpTargetName ${baseProgramName}_${nameValueNbNan}_${nameOptimisationFlag}) generic_compileAndRunExample(${baseTargetName} ${optimsiationMode} "${valueType}" "${optimisationFlag}" "${functionName}" "${valueNbNan}" "${defNanValue}" "${vectorizeOption}" "${configPerformance}" ${PROGRAM_SRC}) list(APPEND listTargetPerf ${tmpTargetName}) endforeach(valueNbNan) phoenix_plotPerf("${baseComparisonPlotName}" ${comparisonProgramName} ${listTargetPerf}) endfunction(multiplePerfTestValue) # Function which creates multiple performance tests automatically (plot result with x axis in log) # baseComparisonPlotName : base name of the comparison plot to be created (for example hadamardProductVectorizeNanO3) # baseTargetName : base name of the target (for example hadamard_product) # optimsiationMode : mode of the optimisation (basic, vectorize, intrinsics) # valueType : type of the inserted value to be tested (nan, denorm) # optimisationFlag : flag of the optimsiation without vectorization (-O0, -O1, -O2, -O3, -Ofast) # defNanValue : definition of the exotic value to be used # vectorizeOption : option for the vectorization # configPerformance : configuration to be passed to the program to get performance restult for each point # ARGN : list of program sources function(multiplePerfTestValueLogX baseComparisonPlotName baseTargetName optimsiationMode valueType optimisationFlag defNanValue vectorizeOption configPerformance) set(PROGRAM_SRC ${ARGN}) set(functionName "${baseTargetName}_${optimsiationMode}") string(REPLACE "-" "" nameOptimisationFlag ${optimisationFlag}) set(baseProgramName "${baseTargetName}_${optimsiationMode}_${valueType}") set(comparisonProgramName "${baseTargetName}_${optimsiationMode}_${nameOptimisationFlag}") set(listRatioNbNan 0.01 0.1 0.25 0.5 0.75 0.9 1) set(listTargetPerf) foreach(valueNbNan ${listRatioNbNan}) string(REPLACE "." "" nameValueNbNan ${valueNbNan}) set(tmpTargetName ${baseProgramName}_${nameValueNbNan}_${nameOptimisationFlag}) generic_compileAndRunExample(${baseTargetName} ${optimsiationMode} "${valueType}" "${optimisationFlag}" "${functionName}" "${valueNbNan}" "${defNanValue}" "${vectorizeOption}" "${configPerformance}" ${PROGRAM_SRC}) list(APPEND listTargetPerf ${tmpTargetName}) endforeach(valueNbNan) phoenix_plotPerfLogX("${baseComparisonPlotName}" ${comparisonProgramName} ${listTargetPerf}) endfunction(multiplePerfTestValueLogX)