Make C10_MOBILE consistent with how feature macros are usually used (#17481)
authorSebastian Messmer <messmer@fb.com>
Thu, 28 Feb 2019 01:54:51 +0000 (17:54 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 28 Feb 2019 01:57:51 +0000 (17:57 -0800)
commit6706e9af195137d7ec63a3cd4b9abde478fd255b
treec3bfb0e7cc0c8160e2da671a6b51d8358a84e10d
parent7c5ffc41206baf391d76c7822aa5bd762db64f3a
Make C10_MOBILE consistent with how feature macros are usually used (#17481)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17481

Usually, feature macros are either defined or undefined and checked accordingly.
C10_MOBILE was a weird special case that was always defined but either defined to 1 or to 0.

This caused a lot of confusion for me when trying to disable something from mobile build and it also disabled it
from the server build (because I was using ifdef). Also, I found a place in the existing code base that made
that wrong assumption and used the macro wrongly, see https://fburl.com/y4icohts

Reviewed By: dzhulgakov

Differential Revision: D14214825

fbshipit-source-id: f3a155b6d43d334e8839e2b2e3c40ed2c773eab6
20 files changed:
aten/src/ATen/core/LegacyTypeDispatch.cpp
aten/src/ATen/core/aten_interned_strings.h
aten/src/ATen/core/interned_strings.h
aten/src/ATen/native/Convolution.cpp
c10/macros/Macros.h
c10/util/numa.cpp
caffe2/core/c10_operator.h
caffe2/core/operator_c10wrapper.h
caffe2/mobile/contrib/ios/ios_caffe_predictor.cc
caffe2/mobile/contrib/ios/mpscnn/mpscnn.mm
caffe2/mobile/contrib/ios/mpscnn/mpscnn_context.mm
caffe2/mobile/contrib/ios/mpscnn/mpscnn_test.mm
caffe2/mobile/contrib/ulp2/ulp.cc
caffe2/onnx/backend.cc
caffe2/operators/conv_transpose_op_mobile.cc
caffe2/operators/conv_transpose_op_mobile.h
caffe2/operators/conv_transpose_op_mobile_impl.h
caffe2/predictor/predictor_config.cc
caffe2/share/contrib/depthwise/depthwise3x3_conv_op.cc
modules/observers/perf_observer.cc