project(PERFORMANCE_WITH_NAN) cmake_minimum_required(VERSION 3.0) include(multiplePerfTest.cmake) set(CONFIG_HADAMARD_PRODUCT "512, 1024, 2048, 2664, 4096, 5008, 10000") set(NAN_DEF "std::numeric_limits::signaling_NaN()") set(INF_DEF "std::numeric_limits::infinity()") set(DENORM_DEF "std::numeric_limits::denorm_min()") set(MIN_TO_DENORM_DEF "std::numeric_limits::min()") set(HADAMARD_PRODUCT_BASE_SRC hadamard_product_base.cpp main_generic.cpp) set(HADAMARD_PRODUCT_VECTORIZE_SRC hadamard_product_vectorize.cpp main_generic.cpp) set(HADAMARD_PRODUCT_INTRINSICS_SRC hadamard_product_intrinsics.cpp main_generic.cpp) multiplePerfTest("hadamardProductBase" hadamard_product base "" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_BASE_SRC}) multiplePerfTest("hadamardProductVectorize" hadamard_product vectorize "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_VECTORIZE_SRC}) multiplePerfTest("hadamardProductIntrinsics" hadamard_product intrinsics "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_INTRINSICS_SRC}) phoenix_plotPerf("cmpHadamardProductSafe03" hadamard_product_base_O3 hadamard_product_vectorize_O3 hadamard_product_intrinsics_O3) phoenix_plotPerf("cmpHadamardProductSafe0fast" hadamard_product_base_Ofast hadamard_product_vectorize_Ofast hadamard_product_intrinsics_Ofast) multiplePerfTestValue("hadamardProductBaseNanO3" hadamard_product base nan -O3 "${NAN_DEF}" "" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_BASE_SRC}) multiplePerfTestValue("hadamardProductVectorizeNanO3" hadamard_product vectorize nan -O3 "${NAN_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_VECTORIZE_SRC}) multiplePerfTestValue("hadamardProductIntrinsicsNanO3" hadamard_product intrinsics nan -O3 "${NAN_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_INTRINSICS_SRC}) multiplePerfTestValue("hadamardProductBaseInfO3" hadamard_product base inf -O3 "${INF_DEF}" "" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_BASE_SRC}) multiplePerfTestValue("hadamardProductVectorizeInfO3" hadamard_product vectorize inf -O3 "${INF_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_VECTORIZE_SRC}) multiplePerfTestValue("hadamardProductIntrinsicsInfO3" hadamard_product intrinsics inf -O3 "${INF_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_INTRINSICS_SRC}) multiplePerfTestValue("hadamardProductBaseDenormO3" hadamard_product base denorm -O3 "${DENORM_DEF}" "" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_BASE_SRC}) multiplePerfTestValue("hadamardProductVectorizeDenormO3" hadamard_product vectorize denorm -O3 "${DENORM_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_VECTORIZE_SRC}) multiplePerfTestValue("hadamardProductIntrinicsDenormO3" hadamard_product intrinsics denorm -O3 "${DENORM_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_INTRINSICS_SRC}) multiplePerfTestValue("hadamardProductBaseDenormDazO3" hadamard_product base denormDaz -O3 "${DENORM_DEF}" "${DENORM_DAZ_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_BASE_SRC}) multiplePerfTestValue("hadamardProductVectorizeDenormDazO3" hadamard_product vectorize denormDaz -O3 "${DENORM_DEF}" "${VECTORIZED_OPTION} ${DENORM_DAZ_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_VECTORIZE_SRC}) multiplePerfTestValue("hadamardProductIntrinicsDenormDazO3" hadamard_product intrinsics denormDaz -O3 "${DENORM_DEF}" "${VECTORIZED_OPTION} ${DENORM_DAZ_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_INTRINSICS_SRC}) multiplePerfTestValue("hadamardProductBaseMakeDenormO3" hadamard_product base make_denorm -O3 "${MIN_TO_DENORM_DEF}" "" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_BASE_SRC}) multiplePerfTestValue("hadamardProductVectorizeMakeDenormO3" hadamard_product vectorize make_denorm -O3 "${MIN_TO_DENORM_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_VECTORIZE_SRC}) multiplePerfTestValue("hadamardProductIntrinicsMakeDenormO3" hadamard_product intrinsics make_denorm -O3 "${MIN_TO_DENORM_DEF}" "${VECTORIZED_OPTION}" "${CONFIG_HADAMARD_PRODUCT}" ${HADAMARD_PRODUCT_INTRINSICS_SRC})