forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStream.h
More file actions
28 lines (22 loc) · 709 Bytes
/
Stream.h
File metadata and controls
28 lines (22 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef THP_STREAM_INC
#define THP_STREAM_INC
#include <c10/core/Stream.h>
#include <c10/macros/Export.h>
#include <torch/csrc/Export.h>
#include <torch/csrc/python_headers.h>
struct THPStream {
PyObject_HEAD
int64_t stream_id;
int64_t device_type;
int64_t device_index;
// Used to switch stream context management, initialized lazily.
PyObject* context;
PyObject* weakreflist;
};
extern TORCH_API PyTypeObject* THPStreamClass;
void THPStream_init(PyObject* module);
inline bool THPStream_Check(PyObject* obj) {
return THPStreamClass && PyObject_IsInstance(obj, (PyObject*)THPStreamClass);
}
TORCH_PYTHON_API PyObject* THPStream_Wrap(const c10::Stream& stream);
#endif // THP_STREAM_INC