Skip to content

Commit

Permalink
Fixign a couple small kmeans bugs (#1274)
Browse files Browse the repository at this point in the history
Authors:
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Divye Gala (https://github.com/divyegala)
  - Ben Frederickson (https://github.com/benfred)

URL: #1274
  • Loading branch information
cjnolet authored Feb 11, 2023
1 parent 4440c39 commit a572397
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpp/include/raft/cluster/detail/kmeans.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ void kmeans_transform(raft::device_resources const& handle,
// n_clusters]
for (IndexT dIdx = 0; dIdx < (IndexT)n_samples; dIdx += dataBatchSize) {
// # of samples for the current batch
auto ns = std::min(dataBatchSize, n_samples - dIdx);
auto ns = std::min(static_cast<IndexT>(dataBatchSize), static_cast<IndexT>(n_samples - dIdx));

// datasetView [ns x n_features] - view representing the current batch of
// input dataset
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/random/detail/make_blobs.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ void generate_data(DataT* out,
raft::random::RngState& rng_state)
{
constexpr IdxT block_size = 128;
IdxT items = n_rows * n_cols;
int64_t items = static_cast<int64_t>(n_rows) * n_cols;
// Choose a grid size so that each thread can write two output values.
IdxT nBlocks = ceildiv<IdxT>(items, 2 * block_size);
int64_t nBlocks = ceildiv<int64_t>(items, 2 * block_size);
// parentheses needed here for kernel, otherwise macro interprets the arguments
// of triple chevron notation as macro arguments
RAFT_CALL_RNG_FUNC(rng_state,
Expand Down

0 comments on commit a572397

Please sign in to comment.