-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix warnings in "ForeachOpsKernels" with c10::irange #50783
Conversation
This pull request was exported from Phabricator. Differential Revision: D25935046 |
This pull request was exported from Phabricator. Differential Revision: D25935046 |
707affa
to
e456913
Compare
This pull request was exported from Phabricator. Differential Revision: D25935046 |
e456913
to
af74922
Compare
Summary: Pull Request resolved: pytorch#50783 Compiling currently shows: ``` Jan 13 16:46:28 In file included from ../aten/src/ATen/native/ForeachOpsKernels.cpp:2: Jan 13 16:46:28 ../aten/src/ATen/native/ForeachUtils.h:28:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachUtils.h:44:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachUtils.h:149:25: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 for (int64_t i = 0; i < tensors1.size(); i++) { Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachUtils.h:164:25: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 for (int64_t i = 0; i < tensors1.size(); i++) { Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachUtils.h:183:25: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 for (int64_t i = 0; i < tensors1.size(); i++) { Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachUtils.h:198:25: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 for (int64_t i = 0; i < tensors1.size(); i++) { Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:150:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST_ALPHA(add); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:74:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST_ALPHA' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:150:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST_ALPHA(add); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:84:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST_ALPHA' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:151:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST_ALPHA(sub); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:74:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST_ALPHA' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:151:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST_ALPHA(sub); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:84:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST_ALPHA' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:158:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(add); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:31:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:158:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(add); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:40:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:159:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(sub); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:31:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:159:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(sub); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:40:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:160:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(mul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:31:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:160:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(mul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:40:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:161:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(div); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:31:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:161:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_SCALARLIST(div); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:40:21: note: expanded from macro 'FOREACH_BINARY_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < tensors.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:163:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST(mul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:53:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:163:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST(mul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:63:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:164:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST(div); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:53:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:164:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_BINARY_OP_LIST(div); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:63:21: note: expanded from macro 'FOREACH_BINARY_OP_LIST' Jan 13 16:46:28 for (int i = 0; i < tensors1.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:195:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALAR(addcdiv); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:115:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALAR' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:195:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALAR(addcdiv); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:125:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALAR' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:196:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALAR(addcmul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:115:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALAR' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:196:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALAR(addcmul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:125:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALAR' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:198:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALARLIST(addcdiv); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:135:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:198:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALARLIST(addcdiv); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:145:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:199:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALARLIST(addcmul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:135:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { \ Jan 13 16:46:28 ~ ^ ~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:199:1: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] Jan 13 16:46:28 FOREACH_POINTWISE_OP_SCALARLIST(addcmul); Jan 13 16:46:28 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Jan 13 16:46:28 ../aten/src/ATen/native/ForeachOpsKernels.cpp:145:21: note: expanded from macro 'FOREACH_POINTWISE_OP_SCALARLIST' Jan 13 16:46:28 for (int i = 0; i < input.size(); i++) { ``` this diff fixes that Test Plan: Sandcastle tests Differential Revision: D25935046 fbshipit-source-id: 7aadfe20508dbdece8fc7434b9717aa0086b786c
This pull request was exported from Phabricator. Differential Revision: D25935046 |
af74922
to
4d47896
Compare
Codecov Report
@@ Coverage Diff @@
## master #50783 +/- ##
=======================================
Coverage 80.85% 80.85%
=======================================
Files 1938 1939 +1
Lines 211184 211187 +3
=======================================
+ Hits 170758 170761 +3
Misses 40426 40426 |
This pull request has been merged in c791a30. |
Summary:
Compiling currently shows:
this diff fixes that
Test Plan: Sandcastle tests
Differential Revision: D25935046