Skip to content

Conversation

@ljk53
Copy link
Contributor

@ljk53 ljk53 commented Apr 25, 2019

Stack from ghstack:

Summary:
Seems pretty innocent change copied from #16242

Test Plan:
Make sure the following warning is gone:
../aten/src/TH/generic/THTensorMoreMath.cpp:1140:34: note: use function 'std::abs' instead
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
^~~~
std::abs

Differential Revision: D15087655

Summary:
Seems pretty innocent change copied from #16242

Test Plan:
Make sure the following warning is gone:
../aten/src/TH/generic/THTensorMoreMath.cpp:1140:34: note: use function 'std::abs' instead
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
                                 ^~~~
                                 std::abs
@dzhulgakov dzhulgakov requested a review from gchanan April 26, 2019 06:55
[pytorch] fix labs warning in THTensorMoreMath.cpp

Summary:
Seems pretty innocent change copied from #16242

Test Plan:
Make sure the following warning is gone:
../aten/src/TH/generic/THTensorMoreMath.cpp:1140:34: note: use function 'std::abs' instead
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
                                 ^~~~
                                 std::abs

gh-metadata: pytorch pytorch 19760 gh/ljk53/12/head
Copy link
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you clarify a few things:

  1. does this warning only happen on mobile builds? I don't see it on CPU builds.
  2. is that the entire warning? Seems strange to start with a note.
  3. none of the other *abs functions warn in this way?

@ljk53
Copy link
Contributor Author

ljk53 commented Apr 30, 2019

@gchanan to your questions:

  1. I see it when I compile with Android NDK r17/r19 + clang;
  2. The entire warning:
[661/793] Building CXX object caffe2/CMakeFiles/caffe2.dir/__/aten/src/TH/THTensorMoreMath.cpp.o
In file included from /data/users/liujiakai/src/pytorch/aten/src/TH/THTensorMoreMath.cpp:7:
In file included from ../aten/src/TH/THGenerateAllTypes.h:11:
In file included from ../aten/src/TH/THGenerateIntTypes.h:14:
In file included from TH/generic/THTensorMoreMath.cpp:1:
../aten/src/TH/generic/THTensorMoreMath.cpp:1142:34: warning: absolute value function 'labs' given an argument of type 'int64_t' (aka 'long long') but has parameter of type 'long' which may cause truncation of value [-Wabsolute-value]
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
                                 ^
../aten/src/TH/generic/THTensorMoreMath.cpp:1142:34: note: use function 'std::abs' instead
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
                                 ^~~~
                                 std::abs
  1. There are other *abs warns, e.g.: TH/generic/THVectorDefault.cpp; I'm not entirely sure why @t-vi modified this specifically. I'm just trying to split it out from his PR. Let me know if you want me to fix others in this PR / separately.

@ljk53 ljk53 requested a review from gchanan April 30, 2019 21:40
ljk53 added 2 commits April 30, 2019 15:24
[pytorch] fix labs warning in THTensorMoreMath.cpp

Summary:
Seems pretty innocent change copied from #16242

Test Plan:
Make sure the following warning is gone:
../aten/src/TH/generic/THTensorMoreMath.cpp:1140:34: note: use function 'std::abs' instead
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
                                 ^~~~
                                 std::abs

gh-metadata: pytorch pytorch 19760 gh/ljk53/12/head
[pytorch] fix labs warning in THTensorMoreMath.cpp

Summary:
Seems pretty innocent change copied from #16242

Test Plan:
Make sure the following warning is gone:
../aten/src/TH/generic/THTensorMoreMath.cpp:1140:34: note: use function 'std::abs' instead
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
                                 ^~~~
                                 std::abs

gh-metadata: pytorch pytorch 19760 gh/ljk53/12/head
ljk53 added a commit that referenced this pull request May 1, 2019
Summary:
Similar to #19760

Test Plan:
- verified the warning is gone;
@zou3519 zou3519 deleted the gh/ljk53/12/head branch May 1, 2019 23:37
@facebook-github-bot
Copy link
Contributor

@ljk53 merged this pull request in 46589a8.

zdevito pushed a commit to zdevito/ATen that referenced this pull request May 2, 2019
Summary:
Pull Request resolved: pytorch/pytorch#19760
ghimport-source-id: d0aabee8c7b881710292d468dca1537c5ea761b5

Differential Revision: D15087655

Pulled By: ljk53

fbshipit-source-id: ac133dfc2301c2a86c41b4b8f1483d7d23824e1e
zhangguanheng66 pushed a commit to zhangguanheng66/pytorch that referenced this pull request May 6, 2019
Summary:
Pull Request resolved: pytorch#19760
ghimport-source-id: d0aabee

Differential Revision: D15087655

Pulled By: ljk53

fbshipit-source-id: ac133dfc2301c2a86c41b4b8f1483d7d23824e1e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: cpu CPU specific problem (e.g., perf, algorithm)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants