1# Copyright (c) 2023 Intel Corporation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15cmake_minimum_required(VERSION 3.5)
16
17project(recursive_fibonacci CXX)
18
19include(../../common/cmake/common.cmake)
20
21set_common_project_settings(tbb)
22
23add_executable(recursive_fibonacci fibonacci.cpp)
24target_link_libraries(recursive_fibonacci
25                      TBB::tbb
26                      Threads::Threads
27                      $<$<PLATFORM_ID:Linux>:rt>)  # Link "rt" library on Linux
28target_compile_options(recursive_fibonacci PRIVATE ${TBB_CXX_STD_FLAG})
29
30set(EXECUTABLE "$<TARGET_FILE:recursive_fibonacci>")
31
32# Parameters of executable N C I:
33# `N` - specifies the fibonacci number which would be calculated.
34# `C` - cutoff that will be used to stop recursive split.
35# `I` - number of iteration to measure benchmark time.
36set(ARGS 30 16 20 1)
37set(PERF_ARGS 50 5 20)
38
39add_execution_target(run_recursive_fibonacci recursive_fibonacci ${EXECUTABLE} "${ARGS}")
40add_execution_target(perf_run_recursive_fibonacci recursive_fibonacci ${EXECUTABLE} "${PERF_ARGS}")
41