Add c10::Stream, make at::cuda::CUDAStream use it.#13133
Closed
Add c10::Stream, make at::cuda::CUDAStream use it.#13133
Conversation
Differential Revision: D10513246 Differential Version: 61419882
Differential Revision: D10513246 Differential Version: 61420227
Differential Revision: D10513246 Differential Version: 61434145
Differential Revision: D10513246 Differential Version: 61443861
Differential Revision: D10520295 Differential Version: 61458546
Differential Revision: D10520421 Differential Version: 61459119
Differential Revision: D10520421 Differential Version: 61459533
Differential Revision: D10520421 Differential Version: 61461399
Differential Revision: D10520421 Differential Version: 61510016
Differential Revision: D10528061 Differential Version: 61512798
Differential Revision: D10520421 Differential Version: 61514357
Differential Revision: D10520421 Differential Version: 61514849
Differential Revision: D10520421 Differential Version: 61532957
Differential Revision: D10520421 Differential Version: 61650165
Differential Revision: D10520421 Differential Version: 61651201
Differential Revision: D10853224 Differential Version: 61658841
Differential Revision: D10853224 Differential Version: 61671204
Differential Revision: D10520421 Differential Version: 61671479
Differential Revision: D10855883 Differential Version: 61676909
This was referenced Oct 25, 2018
Differential Revision: D10853224 Differential Version: 61685989
Differential Revision: D10520421 Differential Version: 61686215
Differential Revision: D10855883 Differential Version: 61686353
gchanan
approved these changes
Oct 26, 2018
| const bool isHighPriority | ||
| , int64_t device) { | ||
| return detail::CUDAStream_getStreamFromPool(isHighPriority, device); | ||
| return CUDAStream(detail::CUDAStream_getStreamFromPool(isHighPriority, device)); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Differential Revision: D10853224 Differential Version: 61786872
Differential Revision: D10520421 Differential Version: 61786871
Differential Revision: D10853224 Differential Version: 61828004
Differential Revision: D10520421 Differential Version: 61828001
Differential Revision: D10855883 Differential Version: 61828003
Differential Revision: D10853224 Differential Version: 61911843
Differential Revision: D10520421 Differential Version: 61911845
Differential Revision: D10855883 Differential Version: 61911844
Differential Revision: D10855883 Differential Version: 61939683
Differential Revision: D10855883 Differential Version: 61985545
dzhulgakov
reviewed
Oct 30, 2018
| return std::greater_equal<const T*>()(ptr, arr.data()) && std::less<const T*>()(ptr, arr.data() + arr.size()); | ||
| } | ||
|
|
||
| static StreamId CUDAStream_getStreamId(const CUDAStreamInternals* ptr) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| * functionality (e.g., get the cudaStream_t of a CUDA stream.) There are | ||
| * wrapper classes which provide this functionality, e.g., CUDAStream. | ||
| */ | ||
| class Stream { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Differential Revision: D10855883 Differential Version: 62135957
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Oct 31, 2018
Summary: Pull Request resolved: pytorch/pytorch#13133 c10::Stream is a device agnostic object which represents a stream on some device (defined as c10::Device). The primary benefit of introducing this object is that we can easily refer to it from code in the non-CUDA library (since it doesn't actually refer to any CUDA specific bits.) Streams are identified by an ID into an appropriate pool. There's some work to translate to and from pointers to the pool; see inline comments. Reviewed By: gchanan Differential Revision: D10855883 fbshipit-source-id: cc447f11a528432e41c2edc789f40e7a6f17bdd3
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Pull Request resolved: pytorch#13133 c10::Stream is a device agnostic object which represents a stream on some device (defined as c10::Device). The primary benefit of introducing this object is that we can easily refer to it from code in the non-CUDA library (since it doesn't actually refer to any CUDA specific bits.) Streams are identified by an ID into an appropriate pool. There's some work to translate to and from pointers to the pool; see inline comments. Reviewed By: gchanan Differential Revision: D10855883 fbshipit-source-id: cc447f11a528432e41c2edc789f40e7a6f17bdd3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack:
:black_circle: #13133 Add c10::Stream, make at::cuda::CUDAStream use it. 💛
:white_circle: #13232 Delete DeviceGuard(int64_t) constructor. 💛
:white_circle: #13275 Replace CUDA-specific set_index(_from) method from DeviceGuard with set_device. 💛
:white_circle: #13342 Generalize DeviceGuard to work with arbitrary DeviceType. 💛
c10::Stream is a device agnostic object which represents a stream
on some device (defined as c10::Device). The primary benefit of
introducing this object is that we can easily refer to it from code
in the non-CUDA library (since it doesn't actually refer to any
CUDA specific bits.)
Streams are identified by an ID into an appropriate pool. There's
some work to translate to and from pointers to the pool; see inline
comments.
Differential Revision: D10855883