-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [x] record_stream
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS | ||
#include <ATen/core/Tensor.h> | ||
#include <c10/xpu/XPUCachingAllocator.h> | ||
|
||
#ifndef AT_PER_OPERATOR_HEADERS | ||
#include <ATen/NativeFunctions.h> | ||
#else | ||
#include <ATen/ops/record_stream_native.h> | ||
#endif | ||
|
||
namespace at::native { | ||
void record_stream_xpu(Tensor& self, c10::Stream stream) { | ||
struct c10::StreamData3 data = stream.pack3(); | ||
c10::xpu::XPUCachingAllocator::recordStream(self.storage().data_ptr(), at::xpu::XPUStream::unpack3(data.stream_id, data.device_index, data.device_type)); | ||
} | ||
} // namespace at::native |
This file contains 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