
# Let's check the influence of the number of performance tests done on a fixed size tables of data

file(GLOB progSrc "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")

set(CONFIG_HADAMARD_PRODUCT "100, 200, 300, 400, 500, 1000")

# phoenix_compileAndRunExample(hadamard_prod_nbTest_O0 "-O0" "${CONFIG_HADAMARD_PRODUCT}" ${progSrc})
# phoenix_compileAndRunExample(hadamard_prod_nbTest_O1 "-O1" "${CONFIG_HADAMARD_PRODUCT}" ${progSrc})
# phoenix_compileAndRunExample(hadamard_prod_nbTest_O2 "-O2" "${CONFIG_HADAMARD_PRODUCT}" ${progSrc})
# phoenix_compileAndRunExample(hadamard_prod_nbTest_O3 "-O3" "${CONFIG_HADAMARD_PRODUCT}" ${progSrc})
# phoenix_compileAndRunExample(hadamard_prod_nbTest_Ofast "-Ofast" "${CONFIG_HADAMARD_PRODUCT}" ${progSrc})
# 
# phoenix_plotPerfLogX("hadamardProdNbTest" hadamard_prod_nbTest_O0 hadamard_prod_nbTest_O1 hadamard_prod_nbTest_O2 hadamard_prod_nbTest_O3 hadamard_prod_nbTest_Ofast)


# Do the performance evaluation of a hadamard product with a given number of tests performed
# 	baseTargetName : base of the given target name
# 	CONFIG_NB_TEST_PERF : number of test to be performed
# 	COMPILATION_OPTION : compilation option
# 	CONFIG_NBELEMENT : configuration of the number of element to be tested
# 	ARGN : source of the program to be compiled and launched
function(phoenix_perf_evaluation_nbTest baseTargetName CONFIG_NB_TEST_PERF COMPILATION_OPTION CONFIG_NBELEMENT)
	set(perfTargetAll)
	foreach(NB_TEST_PERF ${CONFIG_NB_TEST_PERF})
		set(evalTargetName ${baseTargetName}_${NB_TEST_PERF})
		phoenix_compileAndRunExample(${evalTargetName} "${COMPILATION_OPTION} -DNB_TEST_PERF=${NB_TEST_PERF}" "${CONFIG_NBELEMENT}" ${ARGN})
		list(APPEND perfTargetAll ${evalTargetName})
	endforeach(NB_TEST_PERF)
	phoenix_plotPerfLogX(${baseTargetName} ${perfTargetAll})
endfunction(phoenix_perf_evaluation_nbTest)

set(CONFIG_NB_TEST_PERF 10 20 30 50 70 100 200 300 500 800 1000)
phoenix_perf_evaluation_nbTest(pmb_hadamard_prod_nbTest_O3 "${CONFIG_NB_TEST_PERF}" "-O3" "${CONFIG_HADAMARD_PRODUCT}" ${progSrc})

