Skip to content
Merged
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
2 changes: 1 addition & 1 deletion include/nvexec/multi_gpu_context.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace nv::execution

auto operator==(multi_gpu_stream_scheduler const & other) const noexcept -> bool
{
return ctx_.hub_ == other.ctx_.hub_;
return ctx_.hub_ == other.ctx_.hub_ && ctx_.priority_ == other.ctx_.priority_;
}

[[nodiscard]]
Expand Down
2 changes: 1 addition & 1 deletion include/nvexec/stream_context.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace nv::execution

auto operator==(stream_scheduler const & other) const noexcept -> bool
{
return ctx_.hub_ == other.ctx_.hub_;
return ctx_.hub_ == other.ctx_.hub_ && ctx_.priority_ == other.ctx_.priority_;
}

STDEXEC_ATTRIBUTE(nodiscard, host, device) auto schedule() const noexcept
Expand Down
1 change: 1 addition & 0 deletions test/nvexec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ set(nvexec_test_sources
split.cpp
upon_stopped.cpp
transfer.cpp
scheduler.cpp
launch.cpp
let_error.cpp
let_stopped.cpp
Expand Down
42 changes: 42 additions & 0 deletions test/nvexec/scheduler.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include <test_common/catch2.hpp>

#include "nvexec/multi_gpu_context.cuh"
#include "nvexec/stream_context.cuh"

namespace
{
TEST_CASE("nvexec stream scheduler equality includes priority", "[cuda][stream][scheduler]")
{
nvexec::stream_context stream_ctx{};

auto high = stream_ctx.get_scheduler(nvexec::stream_priority::high);
auto normal = stream_ctx.get_scheduler(nvexec::stream_priority::normal);
auto low = stream_ctx.get_scheduler(nvexec::stream_priority::low);

CHECK(high == stream_ctx.get_scheduler(nvexec::stream_priority::high));
CHECK(normal == stream_ctx.get_scheduler(nvexec::stream_priority::normal));
CHECK(low == stream_ctx.get_scheduler(nvexec::stream_priority::low));
CHECK_FALSE(high == normal);
CHECK_FALSE(normal == low);
CHECK_FALSE(high == low);

nvexec::stream_context other_stream_ctx{};
CHECK_FALSE(high == other_stream_ctx.get_scheduler(nvexec::stream_priority::high));
}

TEST_CASE("nvexec multi-GPU scheduler equality includes priority", "[cuda][stream][scheduler]")
{
nvexec::multi_gpu_stream_context stream_ctx{};

auto high = stream_ctx.get_scheduler(nvexec::stream_priority::high);
auto normal = stream_ctx.get_scheduler(nvexec::stream_priority::normal);
auto low = stream_ctx.get_scheduler(nvexec::stream_priority::low);

CHECK(high == stream_ctx.get_scheduler(nvexec::stream_priority::high));
CHECK(normal == stream_ctx.get_scheduler(nvexec::stream_priority::normal));
CHECK(low == stream_ctx.get_scheduler(nvexec::stream_priority::low));
CHECK_FALSE(high == normal);
CHECK_FALSE(normal == low);
CHECK_FALSE(high == low);
}
} // namespace
Loading