diff --git a/doc/runtime_platform.rst b/doc/runtime_platform.rst index 9657168596c605fddbde7f4cfd5765b0c6c58cbb..d6e2ecb859edf03f4f1a769b117e2644df1d04f0 100644 --- a/doc/runtime_platform.rst +++ b/doc/runtime_platform.rst @@ -174,6 +174,8 @@ Context .. automethod:: from_int_ptr .. autoattribute:: int_ptr + .. method:: set_default_device_command_queue(dev, queue) + |comparable| .. function:: create_some_context(interactive=True, answers=None, cache_dir=None) diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp index 55f5e0581cc22fe6c41f34af37b491ff122137f1..436317fe5c70b3e07b71593e4cb16ad084a534cc 100644 --- a/src/wrap_cl.hpp +++ b/src/wrap_cl.hpp @@ -34,7 +34,6 @@ // CL 2.1 missing: // clGetKernelSubGroupInfo -// clSetDefaultDeviceCommandQueue // clEnqueueSVMMigrateMem // CL 2.2 complete @@ -437,6 +436,7 @@ namespace pyopencl { class program; + class command_queue; // {{{ error class error : public std::runtime_error @@ -1229,6 +1229,10 @@ namespace pyopencl return major_ver << 12 | minor_ver << 4; } + +#if PYOPENCL_CL_VERSION >= 0x2010 + void set_default_device_command_queue(device const &dev, command_queue const &queue); +#endif }; @@ -4912,6 +4916,15 @@ namespace pyopencl // {{{ deferred implementation bits +#if PYOPENCL_CL_VERSION >= 0x2010 + inline void context::set_default_device_command_queue(device const &dev, command_queue const &queue) + { + PYOPENCL_CALL_GUARDED(clSetDefaultDeviceCommandQueue, + (m_context, dev.data(), queue.data())); + } +#endif + + inline program *error::get_program() const { return new program(m_program, /* retain */ true); diff --git a/src/wrap_cl_part_1.cpp b/src/wrap_cl_part_1.cpp index d62f6b40ee75665c1f81b594cd1181a90aef7b59..4b0ec771ef4f20dd3edfbc7065152d6492effc39 100644 --- a/src/wrap_cl_part_1.cpp +++ b/src/wrap_cl_part_1.cpp @@ -103,6 +103,9 @@ void pyopencl_expose_part_1(py::module &m) .def(py::self != py::self) .def("__hash__", &cls::hash) PYOPENCL_EXPOSE_TO_FROM_INT_PTR(cl_context) +#if PYOPENCL_CL_VERSION >= 0x2010 + .DEF_SIMPLE_METHOD(set_default_device_command_queue) +#endif ; }