pytorch/c10/cuda/impl
Xiang Gao b1f08e7426 Call uncheckedSetDevice in ~InlineDeviceGuard only when device index are different (#35438)
Summary:
Setting device could be expensive, especially when a debugger is present. We should check the device are different before we set.

cc: ptrblck
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35438

Differential Revision: D20664084

Pulled By: ngimel

fbshipit-source-id: 2440b4c9d96c41b4a19d5b1e8e1756fa40f090f0
2020-03-30 13:13:17 -07:00
..
cuda_cmake_macros.h.in Add c10 cuda library. (#13900) 2018-11-19 08:20:07 -08:00
CUDAGuardImpl.cpp Move CUDAGuard, CUDAStream and CUDAGuardImpl to c10/cuda (#14248) 2018-12-12 11:24:26 -08:00
CUDAGuardImpl.h Call uncheckedSetDevice in ~InlineDeviceGuard only when device index are different (#35438) 2020-03-30 13:13:17 -07:00
CUDATest.cpp Catch cudaError_t return val (nodiscard in rocm) (#16399) 2019-02-11 13:18:36 -08:00
CUDATest.h Add c10 cuda library. (#13900) 2018-11-19 08:20:07 -08:00