1 | #ifndef THP_STREAM_INC |
---|---|
2 | #define THP_STREAM_INC |
3 | |
4 | #include <torch/csrc/python_headers.h> |
5 | |
6 | struct THPStream { |
7 | PyObject_HEAD int64_t stream_id; |
8 | int64_t device_type; |
9 | int64_t device_index; |
10 | }; |
11 | extern PyTypeObject* THPStreamClass; |
12 | |
13 | void THPStream_init(PyObject* module); |
14 | |
15 | inline bool THPStream_Check(PyObject* obj) { |
16 | return THPStreamClass && PyObject_IsInstance(obj, (PyObject*)THPStreamClass); |
17 | } |
18 | |
19 | #endif // THP_STREAM_INC |
20 |