mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136945 Approved by: https://github.com/albanD
25 lines
548 B
C
25 lines
548 B
C
#ifndef THP_STREAM_INC
|
|
#define THP_STREAM_INC
|
|
|
|
#include <c10/core/Stream.h>
|
|
#include <c10/macros/Export.h>
|
|
#include <torch/csrc/python_headers.h>
|
|
|
|
struct THPStream {
|
|
PyObject_HEAD
|
|
int64_t stream_id;
|
|
int64_t device_type;
|
|
int64_t device_index;
|
|
};
|
|
extern TORCH_API PyTypeObject* THPStreamClass;
|
|
|
|
void THPStream_init(PyObject* module);
|
|
|
|
inline bool THPStream_Check(PyObject* obj) {
|
|
return THPStreamClass && PyObject_IsInstance(obj, (PyObject*)THPStreamClass);
|
|
}
|
|
|
|
PyObject* THPStream_Wrap(const c10::Stream& stream);
|
|
|
|
#endif // THP_STREAM_INC
|