From 5af2d551d5f9dea5d432b21a20a5776eaade3f27 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 14 Sep 2020 22:38:30 -0500 Subject: [PATCH] Add cl.device_enqueue_capabilities, more old CL3 header accommodation --- doc/make_constants.py | 5 +++++ pyopencl/__init__.py | 2 ++ src/wrap_cl.hpp | 7 +++++++ src/wrap_constants.cpp | 8 ++++++++ 4 files changed, 22 insertions(+) diff --git a/doc/make_constants.py b/doc/make_constants.py index 5a725810..32b72ce1 100644 --- a/doc/make_constants.py +++ b/doc/make_constants.py @@ -459,6 +459,11 @@ const_ext_lookup = { "SCOPE_ALL_DEVICES": cl_30, }, + cl.device_enqueue_capabilities: { + "SUPPORTED": cl_30, + "REPLACEABLE_DEFAULT": cl_30, + }, + cl.profiling_info: { "COMPLETE": cl_20, }, diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 1fa14a7b..b6c1ac26 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -105,6 +105,7 @@ from pyopencl._cl import ( # noqa: F401 device_partition_property, device_affinity_domain, device_atomic_capabilities, + device_enqueue_capabilities, version_bits, khronos_vendor_id, @@ -240,6 +241,7 @@ BITFIELD_CONSTANT_CLASSES = ( _cl.queue_properties, _cl.svm_mem_flags, _cl.device_atomic_capabilities, + _cl.device_enqueue_capabilities, _cl.version_bits, ) diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp index 4ffb10a4..e9a84264 100644 --- a/src/wrap_cl.hpp +++ b/src/wrap_cl.hpp @@ -965,7 +965,14 @@ namespace pyopencl case CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE: DEV_GET_INT_INF(size_t); case CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT: DEV_GET_INT_INF(cl_bool); case CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT: DEV_GET_INT_INF(cl_bool); + +#ifdef CL_DEVICE_DEVICE_ENQUEUE_SUPPORT case CL_DEVICE_DEVICE_ENQUEUE_SUPPORT: DEV_GET_INT_INF(cl_bool); +#endif +#ifdef CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES + case CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES: DEV_GET_INT_INF(cl_device_enqueue_capabilities); +#endif + case CL_DEVICE_PIPE_SUPPORT: DEV_GET_INT_INF(cl_bool); #endif diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp index 1ea67fb4..785ea7dc 100644 --- a/src/wrap_constants.cpp +++ b/src/wrap_constants.cpp @@ -86,6 +86,7 @@ namespace class device_partition_property { }; class device_affinity_domain { }; class device_atomic_capabilities { }; + class device_enqueue_capabilities { }; class version_bits { }; class khronos_vendor_id { }; @@ -1129,6 +1130,13 @@ void pyopencl_expose_constants(py::module &m) ADD_ATTR(DEVICE_ATOMIC_, SCOPE_ALL_DEVICES); #endif } + { + py::class_ cls(m, "device_enqueue_capabilities"); +#if (PYOPENCL_CL_VERSION >= 0x3000) && defined(CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES) + ADD_ATTR(DEVICE_ENQUEUE, SUPPORTED); + ADD_ATTR(DEVICE_ENQUEUE, REPLACEABLE_DEFAULT); +#endif + } { py::class_ cls(m, "version_bits"); -- GitLab