Skip to content

Commit

Permalink
add cmake option to turn on / off work stealing in DrvX
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwu928 committed Jun 23, 2024
1 parent bab7615 commit 7406b7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions pando-rt/cmake/PANDOCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set_property(CACHE PANDO_RT_ENABLE_MEM_TRACE PROPERTY STRINGS "OFF" "INTER-PXN"
option(PANDO_RT_ENABLE_MEM_STAT "Enable reporting memory access count statistics." OFF)
option(PANDO_RT_DRVX_ENABLE_DMA "Enable reporting memory access count statistics." ON)
option(PANDO_RT_DRVX_ENABLE_BYPASS "Enable bypassing SST simulation in DrvX." ON)
option(PANDO_RT_ENABLE_WORK_STEALING "Enable work stealing for cores." ON)


# Default compiler options for targets
Expand Down
7 changes: 7 additions & 0 deletions pando-rt/src/drvx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ if(PANDO_RT_DRVX_ENABLE_BYPASS STREQUAL "ON")
)
endif()

if(PANDO_RT_ENABLE_WORK_STEALING STREQUAL "ON")
target_compile_definitions(pando-rt-drvx
PUBLIC
"-DPANDO_RT_WORK_STEALING=1"
)
endif()


target_link_libraries(pando-rt-drvx
PUBLIC
Expand Down
6 changes: 3 additions & 3 deletions pando-rt/src/start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ extern "C" int __start(int argc, char** argv) {
auto ctok = queue->makeConsumerToken();

std::optional<pando::Task> task = std::nullopt;
#ifdef PANDO_RT_USE_BACKEND_PREP

#if defined(PANDO_RT_USE_BACKEND_PREP)
SchedulerFailState failState = SchedulerFailState::YIELD;
#endif

Expand All @@ -58,7 +58,7 @@ extern "C" int __start(int argc, char** argv) {
if (!task.has_value()) {
#ifdef PANDO_RT_USE_BACKEND_PREP
pando::Cores::workStealing(task, failState, idleCount, idleTimer);
#elif defined(PANDO_RT_USE_BACKEND_DRVX)
#elif defined(PANDO_RT_USE_BACKEND_DRVX) && defined(PANDO_RT_WORK_STEALING)
pando::Cores::workStealing(task);
#endif
}
Expand Down

0 comments on commit 7406b7f

Please sign in to comment.