diff --git a/cpp/include/raft/cluster/kmeans.cuh b/cpp/include/raft/cluster/kmeans.cuh index 794366e7b9..33bb6fd1ef 100644 --- a/cpp/include/raft/cluster/kmeans.cuh +++ b/cpp/include/raft/cluster/kmeans.cuh @@ -309,12 +309,11 @@ void sample_centroids(const raft::handle_t& handle, template void cluster_cost(const raft::handle_t& handle, raft::device_vector_view minClusterDistance, - rmm::device_uvector workspace, + rmm::device_uvector& workspace, raft::device_scalar_view clusterCost, ReductionOpT reduction_op) { - detail::computeClusterCost( - handle, minClusterDistance, workspace, clusterCost, reduction_op); + detail::computeClusterCost(handle, minClusterDistance, workspace, clusterCost, reduction_op); } /** @@ -843,8 +842,7 @@ void computeClusterCost(const raft::handle_t& handle, raft::device_scalar_view clusterCost, ReductionOpT reduction_op) { - kmeans::cluster_cost( - handle, minClusterDistance, workspace, clusterCost, reduction_op); + kmeans::cluster_cost(handle, minClusterDistance, workspace, clusterCost, reduction_op); } /** diff --git a/cpp/test/matrix/slice.cu b/cpp/test/matrix/slice.cu index 9744e3724a..5faf672d13 100644 --- a/cpp/test/matrix/slice.cu +++ b/cpp/test/matrix/slice.cu @@ -68,11 +68,11 @@ class SliceTest : public ::testing::TestWithParam> { int rows = params.rows, cols = params.cols, len = rows * cols; uniform(handle, r, data.data(), len, T(-10.0), T(10.0)); - std::uniform_int_distribution rowGenerator(0, rows / 2); + std::uniform_int_distribution rowGenerator(0, (rows / 2) - 1); auto row1 = rowGenerator(dre); auto row2 = rowGenerator(dre) + rows / 2; - std::uniform_int_distribution colGenerator(0, cols / 2); + std::uniform_int_distribution colGenerator(0, (cols / 2) - 1); auto col1 = colGenerator(dre); auto col2 = colGenerator(dre) + cols / 2;