Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] Remove RAFT memory management #4468

Merged
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
7 changes: 4 additions & 3 deletions cpp/examples/symreg/symreg_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ int main(int argc, char* argv[])
dw_test.data(), w_test.data(), sizeof(float) * n_test_rows, cudaMemcpyHostToDevice, stream));

// Initialize AST
raft::allocate(d_finalprogs, params.population_size, stream);
auto curr_mr = rmm::mr::get_current_device_resource();
d_finalprogs = static_cast<cg::program_t>(curr_mr->allocate(params.population_size, stream));

std::vector<std::vector<cg::program>> history;
history.reserve(params.generations);
Expand Down Expand Up @@ -337,8 +338,8 @@ int main(int argc, char* argv[])

/* ======================= Reset data ======================= */

raft::deallocate(d_finalprogs, stream);
curr_mr->deallocate(d_finalprogs, params.population_size, stream);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not completely in love with this one because it bypasses the safety of the container / buffer

Copy link
Contributor Author

@viclafargue viclafargue Jan 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! From what I remember, I believe I couldn't use the rmm::device_uvector because the type isn't trivially copyable.

CUDA_RT_CALL(cudaEventDestroy(start));
CUDA_RT_CALL(cudaEventDestroy(stop));
return 0;
}
}
Loading