Skip to content

Commit

Permalink
Fix mst knn test build failure due to RMM device_buffer change (#253)
Browse files Browse the repository at this point in the history
This RMM change has caused below build failure - rapidsai/rmm@7cbcd97 

[ 22%] Building CUDA object CMakeFiles/test_raft.dir/test/sparse/symmetrize.cu.o
/data/raft/cpp/test/mst.cu(202): error: no instance of constructor "rmm::device_buffer::device_buffer" matches the argument list
            argument types are: (int *, unsigned long)
          detected during instantiation of "void raft::mst::MSTTest<vertex_t, edge_t, weight_t>::SetUp() [with vertex_t=int, edge_t=int, weight_t=float]"
/data/raft/cpp/test/mst.cu(205): error: no instance of constructor "rmm::device_buffer::device_buffer" matches the argument list
            argument types are: (int *, unsigned long)
          detected during instantiation of "void raft::mst::MSTTest<vertex_t, edge_t, weight_t>::SetUp() [with vertex_t=int, edge_t=int, weight_t=float]"
/data/raft/cpp/test/mst.cu(208): error: no instance of constructor "rmm::device_buffer::device_buffer" matches the argument list
            argument types are: (float *, unsigned long)
          detected during instantiation of "void raft::mst::MSTTest<vertex_t, edge_t, weight_t>::SetUp() [with vertex_t=int, edge_t=int, weight_t=float]"
3 errors detected in the compilation of "/data/raft/cpp/test/mst.cu".
make[2]: *** [CMakeFiles/test_raft.dir/build.make:594: CMakeFiles/test_raft.dir/test/mst.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/test_raft.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Authors:
  - Mahesh Doijade (https://github.com/mdoijade)

Approvers:
  - Divye Gala (https://github.com/divyegala)
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: #253
  • Loading branch information
mdoijade authored Jun 8, 2021
1 parent f1ea3e0 commit 21cd7b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
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());
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

0 comments on commit 21cd7b0

Please sign in to comment.