Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
psalz committed Oct 9, 2023
1 parent cde3587 commit 8edaae5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
4 changes: 1 addition & 3 deletions include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ namespace debug {
return detail::get_buffer_name(buff);
}

inline void set_task_name(celerity::handler& cgh, const std::string& debug_name) {
detail::set_task_name(cgh, debug_name);
}
inline void set_task_name(celerity::handler& cgh, const std::string& debug_name) { detail::set_task_name(cgh, debug_name); }
} // namespace debug
} // namespace celerity
10 changes: 3 additions & 7 deletions include/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class handler {
friend void detail::add_reduction(handler& cgh, const detail::reduction_info& rinfo);
friend void detail::extend_lifetime(handler& cgh, std::shared_ptr<detail::lifetime_extending_state> state);

friend void detail::set_task_name(handler &cgh, const std::string& debug_name);
friend void detail::set_task_name(handler& cgh, const std::string& debug_name);

detail::task_id m_tid;
detail::buffer_access_map m_access_map;
Expand Down Expand Up @@ -462,11 +462,9 @@ class handler {
}
// Note that cgf_diagnostics has a similar check, but we don't catch void side effects there.
if(!m_side_effects.empty()) { throw std::runtime_error{"Side effects cannot be used in device kernels"}; }
m_task =
detail::task::make_device_compute(m_tid, geometry, std::move(launcher), std::move(m_access_map), std::move(m_reductions));
m_task = detail::task::make_device_compute(m_tid, geometry, std::move(launcher), std::move(m_access_map), std::move(m_reductions));

m_task->set_debug_name(m_usr_def_task_name.value_or(debug_name));

}

void create_collective_task(detail::collective_group_id cgid, std::unique_ptr<detail::command_launcher_storage_base> launcher) {
Expand Down Expand Up @@ -588,9 +586,7 @@ namespace detail {

inline void extend_lifetime(handler& cgh, std::shared_ptr<detail::lifetime_extending_state> state) { cgh.extend_lifetime(std::move(state)); }

inline void set_task_name(handler& cgh, const std::string& debug_name) {
cgh.m_usr_def_task_name = {debug_name};
}
inline void set_task_name(handler& cgh, const std::string& debug_name) { cgh.m_usr_def_task_name = {debug_name}; }

// TODO: The _impl functions in detail only exist during the grace period for deprecated reductions on const buffers; move outside again afterwards.
template <typename DataT, int Dims, typename BinaryOperation>
Expand Down
15 changes: 5 additions & 10 deletions test/debug_naming_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ TEST_CASE("debug names can be set and retrieved from tasks", "[debug]") {
auto tt = test_utils::task_test_context{};

SECTION("Host Task") {
const auto tid_a = test_utils::add_host_task(tt.tm, on_master_node, [&](handler& cgh) {
celerity::debug::set_task_name(cgh, task_name);
});
const auto tid_a = test_utils::add_host_task(tt.tm, on_master_node, [&](handler& cgh) { celerity::debug::set_task_name(cgh, task_name); });

const auto tid_b = test_utils::add_host_task(tt.tm, on_master_node, [&](handler& cgh) {});

Expand All @@ -30,9 +28,7 @@ TEST_CASE("debug names can be set and retrieved from tasks", "[debug]") {
}

SECTION("Compute Task") {
const auto tid_a = test_utils::add_compute_task<class compute_task>(tt.tm, [&](handler& cgh) {
celerity::debug::set_task_name(cgh, task_name);
});
const auto tid_a = test_utils::add_compute_task<class compute_task>(tt.tm, [&](handler& cgh) { celerity::debug::set_task_name(cgh, task_name); });

const auto tid_b = test_utils::add_compute_task<class compute_task_unnamed>(tt.tm, [&](handler& cgh) {});

Expand All @@ -41,9 +37,8 @@ TEST_CASE("debug names can be set and retrieved from tasks", "[debug]") {
}

SECTION("ND Range Task") {
const auto tid_a = test_utils::add_nd_range_compute_task<class nd_range_task>(tt.tm, [&](handler& cgh) {
celerity::debug::set_task_name(cgh, task_name);
});
const auto tid_a =
test_utils::add_nd_range_compute_task<class nd_range_task>(tt.tm, [&](handler& cgh) { celerity::debug::set_task_name(cgh, task_name); });

const auto tid_b = test_utils::add_compute_task<class nd_range_task_unnamed>(tt.tm, [&](handler& cgh) {});

Expand All @@ -61,7 +56,7 @@ TEST_CASE_METHOD(test_utils::runtime_fixture, "buffer_manager allows to set buff


namespace foo {
class MySecondKernel;
class MySecondKernel;
}

template <typename T>
Expand Down

0 comments on commit 8edaae5

Please sign in to comment.