Skip to content

Commit 0d020d9

Browse files
authored
add the io_uring scheduler as the default system scheduler on linux (#1567)
1 parent cc8e3aa commit 0d020d9

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/ci.gpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
# Configure
6868
cmake -S . -B build -GNinja \
6969
-DSTDEXEC_ENABLE_CUDA=ON \
70-
-DSTDEXEC_ENABLE_IO_URING_TESTS=OFF \
70+
-DSTDEXEC_ENABLE_IO_URING=OFF \
7171
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
7272
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
7373
-DCMAKE_CUDA_COMPILER=${{ matrix.cxx }} \

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ endif()
520520
include(CheckIncludeFileCXX)
521521
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
522522
CHECK_INCLUDE_FILE_CXX("dispatch/dispatch.h" STDEXEC_FOUND_LIBDISPATCH)
523-
option(STDEXEC_ENABLE_LIBDISPATCH "Enable the tests for the Grand Central Dispatch scheduler" ${STDEXEC_FOUND_LIBDISPATCH})
523+
option(STDEXEC_ENABLE_LIBDISPATCH "Enable use of the Grand Central Dispatch scheduler" ${STDEXEC_FOUND_LIBDISPATCH})
524524
target_compile_definitions(stdexec INTERFACE STDEXEC_ENABLE_LIBDISPATCH)
525525
endif()
526526

@@ -567,7 +567,7 @@ else()
567567
"
568568
STDEXEC_FOUND_IO_URING)
569569
endif()
570-
option(STDEXEC_ENABLE_IO_URING_TESTS "Enable io_uring tests" ${STDEXEC_FOUND_IO_URING})
570+
option(STDEXEC_ENABLE_IO_URING "Enable the use of the io_uring scheduler on Linux" ${STDEXEC_FOUND_IO_URING})
571571

572572
option(STDEXEC_BUILD_DOCS "Build stdexec documentation" OFF)
573573
option(STDEXEC_BUILD_EXAMPLES "Build stdexec examples" ON)

include/exec/__detail/__system_context_default_impl.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
#include "__system_context_replaceability_api.hpp"
1919

2020
#include "../../stdexec/execution.hpp"
21-
#include "../static_thread_pool.hpp"
2221
#if STDEXEC_ENABLE_LIBDISPATCH
2322
# include "../libdispatch_queue.hpp" // IWYU pragma: keep
23+
#elif STDEXEC_ENABLE_IO_URING
24+
# include "../linux/io_uring_context.hpp" // IWYU pragma: keep
25+
#else
26+
# include "../static_thread_pool.hpp" // IWYU pragma: keep
2427
#endif
2528

2629
#include <atomic>
@@ -365,6 +368,8 @@ namespace exec::__system_context_default_impl {
365368

366369
#if STDEXEC_ENABLE_LIBDISPATCH
367370
using __parallel_scheduler_backend_impl = __generic_impl<exec::libdispatch_queue>;
371+
#elif STDEXEC_ENABLE_IO_URING
372+
using __parallel_scheduler_backend_impl = __generic_impl<exec::io_uring_context>;
368373
#else
369374
using __parallel_scheduler_backend_impl = __generic_impl<exec::static_thread_pool>;
370375
#endif

test/exec/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(exec_test_sources
4040
test_when_any.cpp
4141
test_at_coroutine_exit.cpp
4242
test_materialize.cpp
43-
$<$<BOOL:${STDEXEC_ENABLE_IO_URING_TESTS}>:test_io_uring_context.cpp>
43+
$<$<BOOL:${STDEXEC_ENABLE_IO_URING}>:test_io_uring_context.cpp>
4444
test_trampoline_scheduler.cpp
4545
test_sequence_senders.cpp
4646
test_sequence.cpp

0 commit comments

Comments
 (0)