| commit | a26ad5a3323bcbbc1f2415954e9c5390ff296180 | [log] [tgz] |
|---|---|---|
| author | Yinghai Lu <yinghai@fb.com> | Tue Sep 18 21:05:54 2018 -0700 |
| committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | Tue Sep 18 21:16:18 2018 -0700 |
| tree | 988ddaf21de34ec63d3b7920536da9b1e04a4443 | |
| parent | 8aedc27a6368c6a08038522c72b225f401e64e88 [diff] |
Remove unnecessary check on device option pointer (#11845) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/11845 The device pointer will be used by cudaPointerGetAttributes, which handles nullptr already. So this check is not necessary. https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__UNIFIED.html#group__CUDART__UNIFIED_1gd89830e17d399c064a2f3c3fa8bb4390 Reviewed By: salexspb Differential Revision: D9929828 fbshipit-source-id: d862f7e5590998ffafe9bfc7754b0f83d2ae4af4
diff --git a/caffe2/core/context_gpu.h b/caffe2/core/context_gpu.h index 987c9ff..5fcdb98 100644 --- a/caffe2/core/context_gpu.h +++ b/caffe2/core/context_gpu.h
@@ -403,7 +403,6 @@ } void ExtractDeviceOption(DeviceOption* device, const void* data) override { - CAFFE_ENFORCE(data, "data cannot be nullptr"); device->set_device_type(TypeToProto(GetDeviceType())); device->set_cuda_gpu_id(GetGPUIDForPointer(data)); }