diff --git a/include/nvexec/stream/bulk.cuh b/include/nvexec/stream/bulk.cuh index a3a2a6ab8..9a885cf86 100644 --- a/include/nvexec/stream/bulk.cuh +++ b/include/nvexec/stream/bulk.cuh @@ -138,7 +138,7 @@ namespace nv::execution::_strm static_cast(rcvr), [&](_strm::opstate_base& stream_provider) -> receiver_t { - return receiver_t(self.shape_, static_cast(self.fun_), stream_provider); + return receiver_t(self.shape_, static_cast(self).fun_, stream_provider); }); } STDEXEC_EXPLICIT_THIS_END(connect) diff --git a/test/nvexec/bulk.cpp b/test/nvexec/bulk.cpp index 1573cb94a..35f5992f5 100644 --- a/test/nvexec/bulk.cpp +++ b/test/nvexec/bulk.cpp @@ -21,6 +21,14 @@ namespace (void) snd; } + TEST_CASE("nvexec bulk supports const lvalue senders", "[cuda][stream][adaptors][bulk]") + { + nvexec::stream_context stream_ctx{}; + auto const snd = ex::schedule(stream_ctx.get_scheduler()) | ex::bulk(ex::par, 1, [](int) {}); + + REQUIRE(STDEXEC::sync_wait(snd).has_value()); + } + TEST_CASE("nvexec bulk executes on GPU", "[cuda][stream][adaptors][bulk]") { nvexec::stream_context stream_ctx{};