Skip to content

Commit cde3587

Browse files
GagaLPpsalz
authored andcommitted
Moved all tests regarding debug naming to the new TU debug_naming_tests
1 parent 3f39664 commit cde3587

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

test/buffer_manager_tests.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,13 +1078,6 @@ namespace detail {
10781078
}
10791079
}
10801080

1081-
TEST_CASE_METHOD(test_utils::runtime_fixture, "buffer_manager allows to set buffer debug names on buffers", "[buffer_manager]") {
1082-
celerity::buffer<int, 1> buff_a(16);
1083-
std::string buff_name{"my_buffer"};
1084-
detail::runtime::get_instance().get_buffer_manager().set_debug_name(detail::get_buffer_id(buff_a), buff_name);
1085-
CHECK(detail::runtime::get_instance().get_buffer_manager().get_debug_name(detail::get_buffer_id(buff_a)) == buff_name);
1086-
}
1087-
10881081
TEST_CASE_METHOD(test_utils::device_queue_fixture, "device_queue allows to allocate device memory and query usage", "[device_queue]") {
10891082
auto& dq = get_device_queue();
10901083
const size_t ten_mib = 1024ul * 1024ul * 10ul;

test/debug_naming_tests.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,29 @@ TEST_CASE("debug names can be set and retrieved from tasks", "[debug]") {
5050
CHECK(tt.tm.get_task(tid_a)->get_debug_name() == task_name);
5151
CHECK_THAT(tt.tm.get_task(tid_b)->get_debug_name(), Catch::Matchers::ContainsSubstring("nd_range_task_unnamed"));
5252
}
53+
}
54+
55+
TEST_CASE_METHOD(test_utils::runtime_fixture, "buffer_manager allows to set buffer debug names on buffers", "[buffer_manager]") {
56+
celerity::buffer<int, 1> buff_a(16);
57+
std::string buff_name{"my_buffer"};
58+
celerity::detail::runtime::get_instance().get_buffer_manager().set_debug_name(celerity::detail::get_buffer_id(buff_a), buff_name);
59+
CHECK(celerity::detail::runtime::get_instance().get_buffer_manager().get_debug_name(celerity::detail::get_buffer_id(buff_a)) == buff_name);
60+
}
61+
62+
63+
namespace foo {
64+
class MySecondKernel;
65+
}
66+
67+
template <typename T>
68+
class MyThirdKernel;
69+
70+
TEST_CASE("device_compute tasks derive debug name from kernel name", "[task]") {
71+
auto tm = celerity::detail::task_manager(1, nullptr, {});
72+
const auto t1 = tm.get_task(tm.submit_command_group([](handler& cgh) { cgh.parallel_for<class MyFirstKernel>(range<1>{1}, [](id<1>) {}); }));
73+
const auto t2 = tm.get_task(tm.submit_command_group([](handler& cgh) { cgh.parallel_for<foo::MySecondKernel>(range<1>{1}, [](id<1>) {}); }));
74+
const auto t3 = tm.get_task(tm.submit_command_group([](handler& cgh) { cgh.parallel_for<MyThirdKernel<int>>(range<1>{1}, [](id<1>) {}); }));
75+
CHECK(utils::simplify_task_name(t1->get_debug_name()) == "MyFirstKernel");
76+
CHECK(utils::simplify_task_name(t2->get_debug_name()) == "MySecondKernel");
77+
CHECK(utils::simplify_task_name(t3->get_debug_name()) == "MyThirdKernel<...>");
5378
}

test/runtime_tests.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -288,23 +288,6 @@ namespace detail {
288288
REQUIRE(req == box<3>());
289289
}
290290

291-
namespace foo {
292-
class MySecondKernel;
293-
}
294-
295-
template <typename T>
296-
class MyThirdKernel;
297-
298-
TEST_CASE("device_compute tasks derive debug name from kernel name", "[task]") {
299-
auto tm = detail::task_manager(1, nullptr, {});
300-
const auto t1 = tm.get_task(tm.submit_command_group([](handler& cgh) { cgh.parallel_for<class MyFirstKernel>(range<1>{1}, [](id<1>) {}); }));
301-
const auto t2 = tm.get_task(tm.submit_command_group([](handler& cgh) { cgh.parallel_for<foo::MySecondKernel>(range<1>{1}, [](id<1>) {}); }));
302-
const auto t3 = tm.get_task(tm.submit_command_group([](handler& cgh) { cgh.parallel_for<MyThirdKernel<int>>(range<1>{1}, [](id<1>) {}); }));
303-
CHECK(utils::simplify_task_name(t1->get_debug_name()) == "MyFirstKernel");
304-
CHECK(utils::simplify_task_name(t2->get_debug_name()) == "MySecondKernel");
305-
CHECK(utils::simplify_task_name(t3->get_debug_name()) == "MyThirdKernel<...>");
306-
}
307-
308291
TEST_CASE_METHOD(test_utils::runtime_fixture, "basic SYNC command functionality", "[distr_queue][sync][control-flow]") {
309292
constexpr int N = 10;
310293

0 commit comments

Comments
 (0)