8000 Update on "Add beginnings of torch::stable::accelerator" · pytorch/pytorch@5e8e158 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e8e158

Browse files
Update on "Add beginnings of torch::stable::accelerator"
Adds - `torch::stable::accelerator::DeviceGuard`: `std::unique_ptr` to `DeviceGuardOpauqe` mostly copied from the below (but made generic) https://github.com/pytorch/pytorch/blob/50eac811a68e63e96ad56c11c983bfe298a0bb8a/torch/csrc/inductor/aoti_runtime/utils_cuda.h#L30-L46 - constructor `DeviceGuard(DeviceIndex)` (**this matches aoti but defers from the actual c10 DeviceGuard constructor that takes in device**) - `set_index(DeviceIndex)` - `torch::stable::accelerator::Stream`: `std::shared_ptr` to `StreamOpaque` - constructor `Stream(StreamHandle stream)` (similar to torch::stable::Tensor) - `id() -> StreamId` - `getCurrentStream(DeviceIndex device_index) -> stable::accelerator::Stream` [ghstack-poisoned]
2 parents b08c60c + f7d29ad commit 5e8e158

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/csrc/stable/tensor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#include <torch/csrc/stable/accelerator.h>
1010

11-
using DeviceIndex = torch::stable::accelerator::DeviceIndex;
12-
1311
namespace torch::stable {
1412

13+
using DeviceIndex = torch::stable::accelerator::DeviceIndex;
14+
1515
// The torch::stable::Tensor class is a highlevel C++ wrapper around
1616
// the C shim Tensor APIs. We've modeled this class after TensorBase, as custom
1717
// op kernels only really need to interact with Tensor metadata (think sizes,

0 commit comments

Comments
 (0)
0