From 2670b973ddb87ce391e5254e9c3b03f20e655ddf Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Mon, 20 Mar 2023 14:07:24 -0700 Subject: [PATCH] Fix sign-compare warning in `reorder_array` (#869) `std::vector::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 --- include/cutlass/gemm/device/base_grouped.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cutlass/gemm/device/base_grouped.h b/include/cutlass/gemm/device/base_grouped.h index 1b51291d..e5b50f36 100644 --- a/include/cutlass/gemm/device/base_grouped.h +++ b/include/cutlass/gemm/device/base_grouped.h @@ -157,7 +157,7 @@ private: static void reorder_array(T* data, const std::vector& indices) { // For now, simply create a copy of the data and then copy over to the original. std::vector 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]]; }