mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[CUDA] Remove the uncessary CUDA_GUARD (#160249)
`CUDA_GUARD` is unnecessary in `initDeviceStreamState`, because
the `initSingleStream` has already done it.
29712314dd/c10/cuda/CUDAStream.cpp (L202-L203)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/160249
Approved by: https://github.com/Skylion007
This commit is contained in:
parent
8ae4d2652f
commit
dc0d18e023
|
|
@ -216,9 +216,6 @@ static void initSingleStream(int p, DeviceIndex device_index, int i) {
|
|||
// Creates the low and high priority stream pools for the specified device
|
||||
// Warning: only call once per device!
|
||||
static void initDeviceStreamState(DeviceIndex device_index) {
|
||||
// Switches to the requested device so streams are properly associated
|
||||
// with it.
|
||||
CUDAGuard device_guard{device_index};
|
||||
for (const auto i : c10::irange(kStreamsPerPool)) {
|
||||
for (const auto p : c10::irange(max_stream_priorities)) {
|
||||
initSingleStream(p, device_index, i);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user