mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Low-level PyTorch APIs should be usable/stable enough at this point but we might move the underlying driver API usage a bit from here... Built on top of @drisspg 's branch Pull Request resolved: https://github.com/pytorch/pytorch/pull/159104 Approved by: https://github.com/ngimel, https://github.com/malfet, https://github.com/kwen2501 Co-authored-by: drisspg <drisspguessous@gmail.com> Co-authored-by: Nikita Shulga <2453524+malfet@users.noreply.github.com>
14 lines
533 B
C++
14 lines
533 B
C++
#include <ATen/cuda/CUDAGreenContext.h>
|
|
#include <torch/csrc/jit/python/pybind_utils.h>
|
|
#include <torch/csrc/utils/pybind.h>
|
|
|
|
// Cargo culted partially from csrc/cuda/Stream.cpp
|
|
|
|
void THCPGreenContext_init(PyObject* module) {
|
|
auto m = py::handle(module).cast<py::module>();
|
|
py::class_<at::cuda::GreenContext>(m, "_CUDAGreenContext")
|
|
.def_static("create", &::at::cuda::GreenContext::create)
|
|
.def("set_context", &::at::cuda::GreenContext::setContext)
|
|
.def("pop_context", &::at::cuda::GreenContext::popContext);
|
|
}
|