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

Fix mst knn test build failure due to RMM device_buffer change #253

Merged
merged 4 commits into from
Jun 8, 2021
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
20 changes: 10 additions & 10 deletions cpp/test/mst.cu
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ weight_t prims(CSRHost<vertex_t, edge_t, weight_t> &csr_h) {
auto n_vertices = csr_h.offsets.size() - 1;

bool active_vertex[n_vertices];
// bool mst_set[csr_h.n_edges];
// bool mst_set[csr_h.n_edges];
weight_t curr_edge[n_vertices];

for (auto i = 0; i < n_vertices; i++) {
Expand Down Expand Up @@ -198,15 +198,15 @@ class MSTTest
MSTTestInput<vertex_t, edge_t, weight_t>>::GetParam();
iterations = mst_input.iterations;

csr_d.offsets =
rmm::device_buffer(mst_input.csr_h.offsets.data(),
mst_input.csr_h.offsets.size() * sizeof(edge_t));
csr_d.indices =
rmm::device_buffer(mst_input.csr_h.indices.data(),
mst_input.csr_h.indices.size() * sizeof(vertex_t));
csr_d.weights =
rmm::device_buffer(mst_input.csr_h.weights.data(),
mst_input.csr_h.weights.size() * sizeof(weight_t));
csr_d.offsets = rmm::device_buffer(
mst_input.csr_h.offsets.data(),
mst_input.csr_h.offsets.size() * sizeof(edge_t), handle.get_stream());
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this was a needed change anyway -- default stream is probably not what you wanted here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm that sounds right, but maybe such runtime failure wasn't getting triggered yet.

csr_d.indices = rmm::device_buffer(
mst_input.csr_h.indices.data(),
mst_input.csr_h.indices.size() * sizeof(vertex_t), handle.get_stream());
csr_d.weights = rmm::device_buffer(
mst_input.csr_h.weights.data(),
mst_input.csr_h.weights.size() * sizeof(weight_t), handle.get_stream());
}

void TearDown() override {}
Expand Down
6 changes: 4 additions & 2 deletions cpp/test/spatial/knn.cu
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ class KNNTest : public ::testing::TestWithParam<KNNInputs> {
}
}
rmm::device_buffer input_d = rmm::device_buffer(
row_major_input.data(), row_major_input.size() * sizeof(float));
row_major_input.data(), row_major_input.size() * sizeof(float),
handle_.get_stream());
float *input_ptr = static_cast<float *>(input_d.data());

rmm::device_buffer labels_d = rmm::device_buffer(
params_.labels.data(), params_.labels.size() * sizeof(int));
params_.labels.data(), params_.labels.size() * sizeof(int),
handle_.get_stream());
int *labels_ptr = static_cast<int *>(labels_d.data());

raft::allocate(input_, rows_ * cols_, true);
Expand Down