diff --git a/CMakeLists.txt b/CMakeLists.txt index c443536..8a0cad9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,7 @@ option(INSTALL_DOCS "Specify whether Doxygen docs should be installed" ON) option(WARNINGS_ARE_ERRORS "Specify whether warnings should be treated as errors" OFF) option(USE_AUTOMATIC_INITIALIZATION "Specify whether the MTAPI C++ interface, algorithms and dataflow should automatically intialize the MTAPI node if no explicit initialization is present" ON) option(BUILD_OPENCL_PLUGIN "Specify whether the MTAPI OpenCL plugin should be built" OFF) +option(HARD_REALTIME "Specify whether hard real-time scheduling should be activated" ON) ## LOCAL INSTALLATION OF SUBPROJECT BINARIES # @@ -149,6 +150,10 @@ if(CUDA_FOUND) list(APPEND EXPECTED_EMBB_TEST_EXECUTABLES "embb_mtapi_cuda_c_test") endif() +# Adding hard real-time support with slightly different scheduling +if(HARD_REALTIME STREQUAL ON) + set(EMBB_HARD_REALTIME 1) +endif() ## Copy test execution script to local binaries folder diff --git a/base_c/include/embb/base/c/internal/cmake_config.h.in b/base_c/include/embb/base/c/internal/cmake_config.h.in index f86d3e6..6ff0a84 100644 --- a/base_c/include/embb/base/c/internal/cmake_config.h.in +++ b/base_c/include/embb/base/c/internal/cmake_config.h.in @@ -53,6 +53,12 @@ */ #cmakedefine EMBB_PLATFORM_HAS_GLIB_CPU +/** + * If defined, instead of the MTAPI round-robin work-stealing scheduling with + * local queues per priority, global edf is used for scheduling in order to + * guarantee hard real-time bounds. + */ +#cmakedefine EMBB_HARD_REALTIME #define EMBB_BASE_VERSION_MAJOR ${EMBB_BASE_VERSION_MAJOR} #define EMBB_BASE_VERSION_MINOR ${EMBB_BASE_VERSION_MINOR}