From b35293362a987c25e3dde2c1f116029703ed3b19 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 12 Feb 2016 13:58:39 -0600 Subject: [PATCH] Add note about dev_type choice to Context constructor docs --- doc/runtime.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/runtime.rst b/doc/runtime.rst index f24c41b8..bf639e26 100644 --- a/doc/runtime.rst +++ b/doc/runtime.rst @@ -145,6 +145,24 @@ Platforms, Devices and Contexts :func:`create_some_context`. See, e.g. this `explanation by AMD <http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71>`_. + .. note:: + + Because of how OpenCL changed in order to support Installable Client + Drivers (ICDs) in OpenCL 1.1, the following will *look* reasonable + but often actually not work:: + + import pyopencl as cl + ctx = cl.Context(dev_type=cl.device_type.ALL) + + Instead, make sure to choose a platform when choosing a device by type:: + + import pyopencl as cl + + platforms = cl.get_platforms() + ctx = cl.Context( + dev_type=cl.device_type.ALL, + properties=[(cl.context_properties.PLATFORM, platforms[0])]) + .. note:: For -- GitLab