diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 472d7dc0e6df7a16982927c89fce44fbb96319a5..3d2547e0058091f794357c76a352f97b6d94c075 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -176,8 +176,7 @@ from pyopencl._cl import ( # noqa Image, Sampler, GLTexture, - # FIXME - # DeviceTopologyAmd, + DeviceTopologyAmd, ) import inspect as _inspect diff --git a/src/wrap_cl_part_2.cpp b/src/wrap_cl_part_2.cpp index 0a31ac6c44b1cf5f5f7aa0f6aac580e03a3541f2..1c62f2b2e3f1db14de2fcbabc2c31a084ec88539 100644 --- a/src/wrap_cl_part_2.cpp +++ b/src/wrap_cl_part_2.cpp @@ -441,6 +441,42 @@ void pyopencl_expose_part_2(py::module &m) #endif // }}} + + // {{{ CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD + + { + typedef cl_device_topology_amd cls; + py::class_(m, "DeviceTopologyAmd") + .def(py::init( + [](cl_char bus, cl_char device, cl_char function) + { + cl_device_topology_amd result; + result.pcie.bus = bus; + result.pcie.device = device; + result.pcie.function = function; + return result; + }), + py::arg("bus")=0, + py::arg("device")=0, + py::arg("function")=0) + + .def_property("type", + [](cls &t) { return t.pcie.type; }, + [](cls &t, cl_uint val) { t.pcie.type = val; }) + + .def_property("bus", + [](cls &t) { return t.pcie.bus; }, + [](cls &t, cl_char val) { t.pcie.bus = val; }) + .def_property("device", + [](cls &t) { return t.pcie.device; }, + [](cls &t, cl_char val) { t.pcie.device = val; }) + .def_property("function", + [](cls &t) { return t.pcie.function; }, + [](cls &t, cl_char val) { t.pcie.function = val; }) + ; + } + + // }}} }