Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/nvexec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#=============================================================================

set(nvexec_test_sources
continues_on.cpp
bulk.cpp
ensure_started.cpp
start_detached.cpp
Expand Down
37 changes: 37 additions & 0 deletions test/nvexec/continues_on.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <catch2/catch_all.hpp>
#include <stdexec/execution.hpp>

#include "nvexec/stream_context.cuh"

namespace
{
TEST_CASE("continues on after just", "[cuda][stream][adaptors][continues_on]")
{
nvexec::stream_context ctx;

auto sndr = STDEXEC::just() | STDEXEC::continues_on(ctx.get_scheduler());

STDEXEC::sync_wait(std::move(sndr));
}

TEST_CASE("continues on after schedule", "[cuda][stream][adaptors][continues_on]")
{
nvexec::stream_context ctx;

auto sndr = STDEXEC::schedule(ctx.get_scheduler())
| STDEXEC::continues_on(ctx.get_scheduler());

STDEXEC::sync_wait(std::move(sndr));
}

TEST_CASE("continues on twice in a row should work", "[cuda][stream][adaptors][continues_on]")
{
nvexec::stream_context ctx;

auto sndr = STDEXEC::just()
| STDEXEC::continues_on(ctx.get_scheduler())
| STDEXEC::continues_on(ctx.get_scheduler());

STDEXEC::sync_wait(std::move(sndr));
}
} // namespace