diff options
author | Rick Ratmansky <rratmansky@fb.com> | 2018-10-01 12:09:39 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2018-10-01 12:22:36 -0700 |
commit | 3010dc4208df1d2bd8058cfafeffe645f454595c (patch) | |
tree | e5e087f875dd07d5c959f6edda3162862134d5ce /caffe2/utils | |
parent | ecb3835387e4f5b7f8bfacc1b4d14aeaf687aecd (diff) | |
download | pytorch-3010dc4208df1d2bd8058cfafeffe645f454595c.tar.gz pytorch-3010dc4208df1d2bd8058cfafeffe645f454595c.tar.bz2 pytorch-3010dc4208df1d2bd8058cfafeffe645f454595c.zip |
Revert D10123245: Back out "codemod cuda_gpu_id to device_id"
Differential Revision:
D10123245
Original commit changeset: d83da8e00a12
fbshipit-source-id: fca91fea58b7df208edc2e218a1d514f9821ec7b
Diffstat (limited to 'caffe2/utils')
-rw-r--r-- | caffe2/utils/proto_utils.cc | 4 | ||||
-rw-r--r-- | caffe2/utils/proto_utils_test.cc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/caffe2/utils/proto_utils.cc b/caffe2/utils/proto_utils.cc index dc8e088eba..dd80282238 100644 --- a/caffe2/utils/proto_utils.cc +++ b/caffe2/utils/proto_utils.cc @@ -30,7 +30,7 @@ C10_EXPORT int DeviceId(const DeviceOption& option) { case PROTO_CPU: return option.numa_node_id(); case PROTO_CUDA: - return option.cuda_gpu_id(); + return option.device_id(); case PROTO_MKLDNN: return option.numa_node_id(); case PROTO_HIP: @@ -43,7 +43,7 @@ C10_EXPORT int DeviceId(const DeviceOption& option) { C10_EXPORT bool IsSameDevice(const DeviceOption& lhs, const DeviceOption& rhs) { return ( lhs.device_type() == rhs.device_type() && - lhs.cuda_gpu_id() == rhs.cuda_gpu_id() && + lhs.device_id() == rhs.device_id() && lhs.hip_gpu_id() == rhs.hip_gpu_id() && lhs.node_name() == rhs.node_name() && lhs.numa_node_id() == rhs.numa_node_id()); diff --git a/caffe2/utils/proto_utils_test.cc b/caffe2/utils/proto_utils_test.cc index c9f37f4c98..5d8fb86b34 100644 --- a/caffe2/utils/proto_utils_test.cc +++ b/caffe2/utils/proto_utils_test.cc @@ -11,9 +11,9 @@ TEST(ProtoUtilsTest, IsSameDevice) { EXPECT_FALSE(IsSameDevice(a, b)); b.set_node_name("my_node"); EXPECT_TRUE(IsSameDevice(a, b)); - b.set_cuda_gpu_id(2); + b.set_device_id(2); EXPECT_FALSE(IsSameDevice(a, b)); - a.set_cuda_gpu_id(2); + a.set_device_id(2); EXPECT_TRUE(IsSameDevice(a, b)); a.set_device_type(DeviceTypeProto::PROTO_CUDA); b.set_device_type(DeviceTypeProto::PROTO_CPU); |