Skip to content

Commit

Permalink
Add support for attaching a managed array to a stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
seibert committed Feb 18, 2014
1 parent 401b1ba commit ef401e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cpp/cuda.hpp
Expand Up @@ -1982,6 +1982,14 @@ namespace pycuda
{
return m_devptr;
}

void attach(py::object stream_py, unsigned flags)
{
PYCUDA_PARSE_STREAM_PY;

CUDAPP_CALL_GUARDED(cuStreamAttachMemAsync, (s_handle, m_devptr, 0, flags));
}

};
#endif

Expand Down
2 changes: 2 additions & 0 deletions src/wrapper/wrap_cudadrv.cpp
Expand Up @@ -1141,6 +1141,8 @@ BOOST_PYTHON_MODULE(_driver)

wrp
.DEF_SIMPLE_METHOD(get_device_pointer)
.def("attach", &cl::attach,
(py::arg("stream"), py::arg("mem_flags")))
;
}
#endif
Expand Down

0 comments on commit ef401e2

Please sign in to comment.