Refine return type Stream to HIPStream in HIPStreamGuardMasqueradingAsCUDA (#16978)
authorEdward Yang <ezyang@fb.com>
Tue, 12 Feb 2019 15:22:05 +0000 (07:22 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 12 Feb 2019 15:36:25 +0000 (07:36 -0800)
commitae1fc584ea3a55e5f483f7fd63e6de1b5453f79d
treede485072d2541802f39601a18ceac688269f4562
parentb7b245845a04510b15ca76e199447b64f32d97e4
Refine return type Stream to HIPStream in HIPStreamGuardMasqueradingAsCUDA (#16978)

Summary:
Previously, we used the templated class directly to provide
implementations.  However, there is a subtle difference
between this, and CUDAStreamGuard: CUDAStreamGuard has refined types
for the Streams it returns.  This lead to a compilation failure
of HIPified ddp.cpp.  This commit lines them up more closely,
at the cost of copy-paste.

A possible alternate strategy would have been to extend the
InlineDeviceGuard templates to optionally accept refinements
for Stream.  I leave this for future work.

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16978

Differential Revision: D14045346

Pulled By: ezyang

fbshipit-source-id: 2b101606e62e4db588027c57902ea739a2119410
aten/src/ATen/hip/impl/HIPGuardImplMasqueradingAsCUDA.h