Skip to content

Commit

Permalink
Fix sign-compare warning in reorder_array (NVIDIA#869)
Browse files Browse the repository at this point in the history
`std::vector<T>::size_type` is unsigned type, so let's iterate over unsigned type as well


Discovered, while trying to enable PyTorch building without `-Wno-sign-compare` warning suppression, see https://github.com/pytorch/pytorch/actions/runs/4418987999/jobs/7746850762#step:10:10532
  • Loading branch information
malfet authored Mar 20, 2023
1 parent af332d4 commit 2670b97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/cutlass/gemm/device/base_grouped.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class BaseGrouped {
static void reorder_array(T* data, const std::vector<size_t>& indices) {
// For now, simply create a copy of the data and then copy over to the original.
std::vector<T> copy(indices.size());
for (int i = 0; i < indices.size(); ++i) {
for (unsigned i = 0; i < indices.size(); ++i) {
copy.at(i) = data[indices[i]];
}

Expand Down

0 comments on commit 2670b97

Please sign in to comment.