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

[BUG] Fix kmeans cluster templates #966

Merged
merged 2 commits into from
Nov 1, 2022
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
8 changes: 3 additions & 5 deletions cpp/include/raft/cluster/kmeans.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,11 @@ void sample_centroids(const raft::handle_t& handle,
template <typename DataT, typename IndexT, typename ReductionOpT>
void cluster_cost(const raft::handle_t& handle,
raft::device_vector_view<DataT, IndexT> minClusterDistance,
rmm::device_uvector<char> workspace,
rmm::device_uvector<char>& workspace,
raft::device_scalar_view<DataT> clusterCost,
ReductionOpT reduction_op)
{
detail::computeClusterCost<DataT, ReductionOpT, IndexT>(
handle, minClusterDistance, workspace, clusterCost, reduction_op);
detail::computeClusterCost(handle, minClusterDistance, workspace, clusterCost, reduction_op);
}

/**
Expand Down Expand Up @@ -843,8 +842,7 @@ void computeClusterCost(const raft::handle_t& handle,
raft::device_scalar_view<DataT> clusterCost,
ReductionOpT reduction_op)
{
kmeans::cluster_cost<DataT, ReductionOpT, IndexT>(
handle, minClusterDistance, workspace, clusterCost, reduction_op);
kmeans::cluster_cost(handle, minClusterDistance, workspace, clusterCost, reduction_op);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cpp/test/matrix/slice.cu
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ class SliceTest : public ::testing::TestWithParam<SliceInputs<T>> {
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<int> rowGenerator(0, rows / 2);
std::uniform_int_distribution<int> rowGenerator(0, (rows / 2) - 1);
auto row1 = rowGenerator(dre);
auto row2 = rowGenerator(dre) + rows / 2;

std::uniform_int_distribution<int> colGenerator(0, cols / 2);
std::uniform_int_distribution<int> colGenerator(0, (cols / 2) - 1);
auto col1 = colGenerator(dre);
auto col2 = colGenerator(dre) + cols / 2;

Expand Down