Skip to content

Commit

Permalink
#2063: Update char* to std::byte* in Scatter
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Apr 12, 2024
1 parent 5c1e2e9 commit 5207a52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/vt/collective/scatter/scatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ Scatter::Scatter()
: tree::Tree(tree::tree_cons_tag_t)
{ }

char* Scatter::applyScatterRecur(
NodeType node, char* ptr, std::size_t elm_size, FuncSizeType size_fn,
std::byte* Scatter::applyScatterRecur(
NodeType node, std::byte* ptr, std::size_t elm_size, FuncSizeType size_fn,
FuncDataType data_fn
) {
// pre-order k-ary tree traversal for data layout
auto children = Tree::getChildren(node);
char* cur_ptr = ptr;
auto cur_ptr = ptr;
vt_debug_print(
normal, scatter,
"Scatter::applyScatterRecur: elm_size={}, ptr={}, node={}\n",
elm_size, print_ptr(ptr), node
);
data_fn(node, reinterpret_cast<std::byte*>(cur_ptr));
data_fn(node, cur_ptr);
cur_ptr += elm_size;
for (auto&& child : children) {
vt_debug_print(
Expand Down
4 changes: 2 additions & 2 deletions src/vt/collective/scatter/scatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ struct Scatter : virtual collective::tree::Tree {
*
* \return incremented point after scatter is complete
*/
char* applyScatterRecur(
NodeType node, char* ptr, std::size_t elm_size, FuncSizeType size_fn,
std::byte* applyScatterRecur(
NodeType node, std::byte* ptr, std::size_t elm_size, FuncSizeType size_fn,
FuncDataType data_fn
);

Expand Down
6 changes: 3 additions & 3 deletions src/vt/collective/scatter/scatter.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ void Scatter::scatter(
print_ptr(ptr), remaining_size
);
auto const& root_node = 0;
auto nptr = applyScatterRecur(root_node, ptr, elm_size, size_fn, data_fn);
auto nptr = applyScatterRecur(root_node, reinterpret_cast<std::byte*>(ptr), elm_size, size_fn, data_fn);
vt_debug_print(
verbose, scatter, "Scatter::scatter: incremented size={}\n", nptr - ptr
verbose, scatter, "Scatter::scatter: incremented size={}\n", nptr - reinterpret_cast<std::byte*>(ptr)
);
vtAssert(nptr == ptr + combined_size, "nptr must match size");
vtAssert(nptr == reinterpret_cast<std::byte*>(ptr + combined_size), "nptr must match size");
auto const& handler = auto_registry::makeScatterHandler<MessageT, f>();
auto const& this_node = theContext()->getNode();
scatter_msg->user_han = handler;
Expand Down

0 comments on commit 5207a52

Please sign in to comment.