1# ----------------------------------------------------------------------------- 2# Benchmarks 3# ----------------------------------------------------------------------------- 4set(FFRT_BENCHMARK_PATH ${PROJECT_SOURCE_DIR}/benchmarks) 5include_directories(${FFRT_BENCHMARK_PATH}) 6 7option(BENCHMARKS_BASE "Enables Benchmarks Base" ON) 8option(BENCHMARKS_FORK_JOIN "Enables Benchmarks Fork Join" ON) 9option(BENCHMARKS_FIB "Enables Benchmarks FIB" ON) 10option(BENCHMARKS_FACE_STORY "Enables Benchmarks Face Story" ON) 11option(BENCHMARKS_SPEEDUP "Enables Speedup test" ON) 12option(BENCHMARKS_SERIAL_SCHED_TIME "Enables completely serial schedule time test" ON) 13 14message(STATUS "BENCHMARKS_BASE: " ${BENCHMARKS_BASE}) 15message(STATUS "BENCHMARKS_FORK_JOIN: " ${BENCHMARKS_FORK_JOIN}) 16message(STATUS "BENCHMARKS_FIB: " ${BENCHMARKS_FIB}) 17message(STATUS "BENCHMARKS_FACE_STORY: " ${BENCHMARKS_FACE_STORY}) 18message(STATUS "BENCHMARKS_SPEEDUP: " ${BENCHMARKS_SPEEDUP}) 19message(STATUS "BENCHMARKS_SERIAL_SCHED_TIME: " ${BENCHMARKS_SERIAL_SCHED_TIME}) 20 21LINK_DIRECTORIES(${FFRT_BUILD_PATH}) 22 23set(FFRT_LD_FLAGS "-lffrt") 24 25if (BENCHMARKS_BASE STREQUAL ON) 26 add_executable(base ${FFRT_BENCHMARK_PATH}/base/base.cpp) 27 target_link_libraries(base ${FFRT_LD_FLAGS}) 28endif() 29 30if (BENCHMARKS_FIB STREQUAL ON) 31 add_executable(fib ${FFRT_BENCHMARK_PATH}/fib/fib.cpp) 32 target_link_libraries(fib ${FFRT_LD_FLAGS}) 33endif() 34 35if (BENCHMARKS_FORK_JOIN STREQUAL ON) 36 add_executable(fork_join ${FFRT_BENCHMARK_PATH}/fork_join/fork_join.cpp) 37 target_link_libraries(fork_join ${FFRT_LD_FLAGS}) 38endif() 39 40if (BENCHMARKS_FACE_STORY STREQUAL ON) 41 add_executable(face_story ${FFRT_BENCHMARK_PATH}/face_story/face_story.cpp) 42 target_link_libraries(face_story ${FFRT_LD_FLAGS}) 43endif() 44 45# speedup test 46if (BENCHMARKS_SPEEDUP STREQUAL ON) 47 add_subdirectory(speedup) 48endif() 49 50# serial schedule time test 51if (BENCHMARKS_SERIAL_SCHED_TIME STREQUAL ON) 52 add_subdirectory(serial_sched_time) 53endif()