From c588d9f6c6502e1dccc7a7a950862dba4e96c568 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 10 Aug 2018 17:46:05 -0500 Subject: [PATCH] [pybind] Fixes for CL2 constants --- pyopencl/__init__.py | 2 -- setup.py | 2 +- src/wrap_cl.hpp | 7 ++++--- src/wrap_constants.cpp | 9 +++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 0b3de63a..eb124749 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -101,12 +101,10 @@ from pyopencl._cl import ( # noqa command_execution_status, profiling_info, mem_migration_flags, - mem_migration_flags_ext, device_partition_property, device_affinity_domain, gl_object_type, gl_texture_info, - migrate_mem_object_flags_ext, Error, MemoryError, LogicError, RuntimeError, diff --git a/setup.py b/setup.py index b8b44f40..0e6aaf80 100644 --- a/setup.py +++ b/setup.py @@ -223,10 +223,10 @@ def main(): ext_modules=[ NumpyExtension("pyopencl._cl", [ + "src/wrap_constants.cpp", "src/wrap_cl.cpp", "src/wrap_cl_part_1.cpp", "src/wrap_cl_part_2.cpp", - "src/wrap_constants.cpp", "src/wrap_mempool.cpp", "src/bitlog.cpp", ], diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp index 94efb804..03173cd6 100644 --- a/src/wrap_cl.hpp +++ b/src/wrap_cl.hpp @@ -812,9 +812,10 @@ namespace pyopencl case CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT: DEV_GET_INT_INF(cl_uint); #endif #if PYOPENCL_CL_VERSION >= 0x2010 - case CL_DEVICE_IL_VERSION: DEV_GET_INT_INF(); - case CL_DEVICE_MAX_NUM_SUB_GROUPS: DEV_GET_INT_INF(); - case CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: DEV_GET_INT_INF(); + case CL_DEVICE_IL_VERSION: + PYOPENCL_GET_STR_INFO(Device, m_device, param_name); + case CL_DEVICE_MAX_NUM_SUB_GROUPS: DEV_GET_INT_INF(cl_uint); + case CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: DEV_GET_INT_INF(cl_bool); #endif #ifdef CL_DEVICE_ME_VERSION_INTEL case CL_DEVICE_ME_VERSION_INTEL: DEV_GET_INT_INF(cl_uint); diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp index 7bf410c9..0627fe85 100644 --- a/src/wrap_constants.cpp +++ b/src/wrap_constants.cpp @@ -21,7 +21,9 @@ namespace class gl_context_info { }; class context_properties { }; class command_queue_info { }; + class queue_properties { }; class mem_flags { }; + class svm_mem_flags { }; class channel_order { }; class channel_type { }; class mem_object_type { }; @@ -557,9 +559,8 @@ void pyopencl_expose_constants(py::module &m) } { - // queue_properties -#if PYOPENCL_CL_VERSION >= 0x2000 py::class_ cls(m, "queue_properties"); +#if PYOPENCL_CL_VERSION >= 0x2000 ADD_ATTR(QUEUE_, PROPERTIES); ADD_ATTR(QUEUE_, SIZE); #endif @@ -587,8 +588,8 @@ void pyopencl_expose_constants(py::module &m) } { -#if PYOPENCL_CL_VERSION >= 0x2000 py::class_ cls(m, "svm_mem_flags"); +#if PYOPENCL_CL_VERSION >= 0x2000 ADD_ATTR(MEM_, READ_WRITE); ADD_ATTR(MEM_, WRITE_ONLY); ADD_ATTR(MEM_, READ_ONLY); @@ -911,7 +912,7 @@ void pyopencl_expose_constants(py::module &m) ADD_ATTR(PROFILING_COMMAND_, START); ADD_ATTR(PROFILING_COMMAND_, END); #if PYOPENCL_CL_VERSION >= 0x2000 - ADD_ATTR("profiling_info", PROFILING_COMMAND_, COMPLETE); + ADD_ATTR(PROFILING_COMMAND_, COMPLETE); #endif } -- GitLab