<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>OpenCL Runtime — PyOpenCL 2013.1 documentation</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="_static/akdoc.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '2013.1', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: false }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="PyOpenCL 2013.1 documentation" href="index.html" /> <link rel="next" title="Multi-dimensional arrays" href="array.html" /> <link rel="prev" title="Welcome to PyOpenCL’s documentation!" href="index.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="array.html" title="Multi-dimensional arrays" accesskey="N">next</a> |</li> <li class="right" > <a href="index.html" title="Welcome to PyOpenCL’s documentation!" accesskey="P">previous</a> |</li> <li><a href="index.html">PyOpenCL 2013.1 documentation</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <span class="target" id="reference-doc"></span><div class="section" id="opencl-runtime"> <h1>OpenCL Runtime<a class="headerlink" href="#opencl-runtime" title="Permalink to this headline">¶</a></h1> <div class="section" id="module-pyopencl"> <span id="version-queries"></span><h2>Version Queries<a class="headerlink" href="#module-pyopencl" title="Permalink to this headline">¶</a></h2> <dl class="data"> <dt id="pyopencl.VERSION"> <tt class="descclassname">pyopencl.</tt><tt class="descname">VERSION</tt><a class="headerlink" href="#pyopencl.VERSION" title="Permalink to this definition">¶</a></dt> <dd><p>Gives the numeric version of PyOpenCL as a variable-length tuple of integers. Enables easy version checks such as <em>VERSION >= (0, 93)</em>.</p> </dd></dl> <dl class="data"> <dt id="pyopencl.VERSION_STATUS"> <tt class="descclassname">pyopencl.</tt><tt class="descname">VERSION_STATUS</tt><a class="headerlink" href="#pyopencl.VERSION_STATUS" title="Permalink to this definition">¶</a></dt> <dd><p>A text string such as <cite>“rc4”</cite> or <cite>“beta”</cite> qualifying the status of the release.</p> </dd></dl> <dl class="data"> <dt id="pyopencl.VERSION_TEXT"> <tt class="descclassname">pyopencl.</tt><tt class="descname">VERSION_TEXT</tt><a class="headerlink" href="#pyopencl.VERSION_TEXT" title="Permalink to this definition">¶</a></dt> <dd><p>The full release name (such as <cite>“0.93rc4”</cite>) in string form.</p> </dd></dl> <dl class="function"> <dt id="pyopencl.get_cl_header_version"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_cl_header_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.get_cl_header_version" title="Permalink to this definition">¶</a></dt> <dd><p>Return a variable-length tuple of integers representing the version of the OpenCL header against which PyOpenCL was compiled.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.92.</span></p> </div> </dd></dl> </div> <div class="section" id="error-reporting"> <span id="errors"></span><h2>Error Reporting<a class="headerlink" href="#error-reporting" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="pyopencl.Error"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Error</tt><a class="headerlink" href="#pyopencl.Error" title="Permalink to this definition">¶</a></dt> <dd><p>Base class for all PyOpenCL exceptions.</p> </dd></dl> <dl class="class"> <dt id="pyopencl.MemoryError"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">MemoryError</tt><a class="headerlink" href="#pyopencl.MemoryError" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="class"> <dt id="pyopencl.LogicError"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">LogicError</tt><a class="headerlink" href="#pyopencl.LogicError" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="class"> <dt id="pyopencl.RuntimeError"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">RuntimeError</tt><a class="headerlink" href="#pyopencl.RuntimeError" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </div> <div class="section" id="constants"> <h2>Constants<a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h2> </div> <div class="section" id="platforms-devices-and-contexts"> <h2>Platforms, Devices and Contexts<a class="headerlink" href="#platforms-devices-and-contexts" title="Permalink to this headline">¶</a></h2> <dl class="function"> <dt id="pyopencl.get_platforms"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_platforms</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.get_platforms" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of <a class="reference internal" href="#pyopencl.Platform" title="pyopencl.Platform"><tt class="xref py py-class docutils literal"><span class="pre">Platform</span></tt></a> instances.</p> </dd></dl> <dl class="class"> <dt id="pyopencl.Platform"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Platform</tt><a class="headerlink" href="#pyopencl.Platform" title="Permalink to this definition">¶</a></dt> <dd><dl class="attribute"> <dt id="pyopencl.Platform.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Platform.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">platform_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Platform.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Platform.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">platform_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Platform.get_devices"> <tt class="descname">get_devices</tt><big>(</big><em>device_type=device_type.ALL</em><big>)</big><a class="headerlink" href="#pyopencl.Platform.get_devices" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of devices matching <em>device_type</em>. See <tt class="xref py py-class docutils literal"><span class="pre">device_type</span></tt> for values of <em>device_type</em>.</p> </dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="class"> <dt id="pyopencl.Device"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Device</tt><a class="headerlink" href="#pyopencl.Device" title="Permalink to this definition">¶</a></dt> <dd><dl class="attribute"> <dt id="pyopencl.Device.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Device.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">device_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Device.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Device.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">device_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <p>Two instances of this class may be compared using <em>==”</em> and <em>”!=”</em>.</p> </dd></dl> <dl class="class"> <dt id="pyopencl.Context"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Context</tt><big>(</big><em>devices=None</em>, <em>properties=None</em>, <em>dev_type=None</em><big>)</big><a class="headerlink" href="#pyopencl.Context" title="Permalink to this definition">¶</a></dt> <dd><p>Create a new context. <em>properties</em> is a list of key-value tuples, where each key must be one of <tt class="xref py py-class docutils literal"><span class="pre">context_properties</span></tt>. At most one of <em>devices</em> and <em>dev_type</em> may be not <cite>None</cite>, where <em>devices</em> is a list of <a class="reference internal" href="#pyopencl.Device" title="pyopencl.Device"><tt class="xref py py-class docutils literal"><span class="pre">Device</span></tt></a> instances, and <em>dev_type</em> is one of the <tt class="xref py py-class docutils literal"><span class="pre">device_type</span></tt> constants. If neither is specified, a context with a <em>dev_type</em> of <tt class="xref py py-attr docutils literal"><span class="pre">device_type.DEFAULT</span></tt> is created.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Calling the constructor with no arguments will fail for recent CL drivers that support the OpenCL ICD. If you want similar, just-give-me-a-context-already behavior, we recommend <a class="reference internal" href="#pyopencl.create_some_context" title="pyopencl.create_some_context"><tt class="xref py py-func docutils literal"><span class="pre">create_some_context()</span></tt></a>. See, e.g. this <a class="reference external" href="http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=71">explanation by AMD</a>.</p> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">For <tt class="xref py py-attr docutils literal"><span class="pre">context_properties.CL_GL_CONTEXT_KHR</span></tt>, <tt class="xref py py-attr docutils literal"><span class="pre">context_properties.CL_EGL_DISPLAY_KHR</span></tt>, <tt class="xref py py-attr docutils literal"><span class="pre">context_properties.CL_GLX_DISPLAY_KHR</span></tt>, <tt class="xref py py-attr docutils literal"><span class="pre">context_properties.CL_WGL_HDC_KHR</span></tt>, and <tt class="xref py py-attr docutils literal"><span class="pre">context_properties.CL_CGL_SHAREGROUP_KHR</span></tt> <tt class="xref py py-attr docutils literal"><span class="pre">context_properties.CL_CGL_SHAREGROUP_APPLE</span></tt> the value in the key-value pair is a PyOpenGL context or display instance.</p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 0.91.2: </span>Constructor arguments <em>dev_type</em> added.</p> </div> <dl class="attribute"> <dt id="pyopencl.Context.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Context.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">context_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Context.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Context.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">context_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Context.create_sub_devices"> <tt class="descname">create_sub_devices</tt><big>(</big><em>properties</em><big>)</big><a class="headerlink" href="#pyopencl.Context.create_sub_devices" title="Permalink to this definition">¶</a></dt> <dd><p><em>properties</em> is an array of one (or more) of the forms:</p> <div class="highlight-python"><div class="highlight"><pre><span class="p">[</span> <span class="n">dpp</span><span class="o">.</span><span class="n">EQUALLY</span><span class="p">,</span> <span class="mi">8</span><span class="p">]</span> <span class="p">[</span> <span class="n">dpp</span><span class="o">.</span><span class="n">BY_COUNTS</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="n">dpp</span><span class="o">.</span><span class="n">PARTITION_BY_COUNTS_LIST_END</span><span class="p">]</span> <span class="p">[</span> <span class="n">dpp</span><span class="o">.</span><span class="n">BY_NAMES</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="n">dpp</span><span class="o">.</span><span class="n">PARTITION_BY_NAMES_LIST_END</span><span class="p">]</span> <span class="p">[</span> <span class="n">dpp</span><span class="o">.</span><span class="n">BY_AFFINITY_DOMAIN</span><span class="p">,</span> <span class="n">dad</span><span class="o">.</span><span class="n">L1_CACHE</span><span class="p">]</span> </pre></div> </div> <p>where <cite>dpp</cite> represents <tt class="xref py py-class docutils literal"><span class="pre">device_partition_property</span></tt> and <cite>dad</cite> represent <tt class="xref py py-class docutils literal"><span class="pre">device_affinity_domain</span></tt>.</p> <p><cite>PROPERTIES_LIST_END_EXT</cite> is added automatically.</p> <p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> <dl class="method"> <dt id="pyopencl.Context.create_sub_devices_ext"> <tt class="descname">create_sub_devices_ext</tt><big>(</big><em>properties</em><big>)</big><a class="headerlink" href="#pyopencl.Context.create_sub_devices_ext" title="Permalink to this definition">¶</a></dt> <dd><p><em>properties</em> is an array of one (or more) of the forms:</p> <div class="highlight-python"><div class="highlight"><pre><span class="p">[</span> <span class="n">dppe</span><span class="o">.</span><span class="n">EQUALLY</span><span class="p">,</span> <span class="mi">8</span><span class="p">]</span> <span class="p">[</span> <span class="n">dppe</span><span class="o">.</span><span class="n">BY_COUNTS</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="n">dppe</span><span class="o">.</span><span class="n">PARTITION_BY_COUNTS_LIST_END</span><span class="p">]</span> <span class="p">[</span> <span class="n">dppe</span><span class="o">.</span><span class="n">BY_NAMES</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="n">dppe</span><span class="o">.</span><span class="n">PARTITION_BY_NAMES_LIST_END</span><span class="p">]</span> <span class="p">[</span> <span class="n">dppe</span><span class="o">.</span><span class="n">BY_AFFINITY_DOMAIN</span><span class="p">,</span> <span class="n">ad</span><span class="o">.</span><span class="n">L1_CACHE</span><span class="p">]</span> </pre></div> </div> <p>where <cite>dppe</cite> represents <tt class="xref py py-class docutils literal"><span class="pre">device_partition_property_ext</span></tt> and <cite>ad</cite> represent <tt class="xref py py-class docutils literal"><span class="pre">affinity_domain_ext</span></tt>.</p> <p><cite>PROPERTIES_LIST_END_EXT</cite> is added automatically.</p> <p>Only available with the <cite>cl_ext_device_fission</cite> extension.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.1.</span></p> </div> </dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="function"> <dt id="pyopencl.create_some_context"> <tt class="descclassname">pyopencl.</tt><tt class="descname">create_some_context</tt><big>(</big><em>interactive=True</em><big>)</big><a class="headerlink" href="#pyopencl.create_some_context" title="Permalink to this definition">¶</a></dt> <dd><p>Create a <a class="reference internal" href="#pyopencl.Context" title="pyopencl.Context"><tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt></a> ‘somehow’.</p> <p>If multiple choices for platform and/or device exist, <em>interactive</em> is True, and <em>sys.stdin.isatty()</em> is also True, then the user is queried about which device should be chosen. Otherwise, a device is chosen in an implementation-defined manner.</p> </dd></dl> </div> <div class="section" id="command-queues-and-events"> <h2>Command Queues and Events<a class="headerlink" href="#command-queues-and-events" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="pyopencl.CommandQueue"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">CommandQueue</tt><big>(</big><em>context</em>, <em>device=None</em>, <em>properties=None</em><big>)</big><a class="headerlink" href="#pyopencl.CommandQueue" title="Permalink to this definition">¶</a></dt> <dd><p>Create a new command queue. <em>properties</em> is a bit field consisting of <tt class="xref py py-class docutils literal"><span class="pre">command_queue_properties</span></tt> values.</p> <p>if <em>device</em> is None, one of the devices in <em>context</em> is chosen in an implementation-defined manner.</p> <p>A <a class="reference internal" href="#pyopencl.CommandQueue" title="pyopencl.CommandQueue"><tt class="xref py py-class docutils literal"><span class="pre">CommandQueue</span></tt></a> may be used as a context manager, like this:</p> <div class="highlight-python"><div class="highlight"><pre><span class="k">with</span> <span class="n">cl</span><span class="o">.</span><span class="n">CommandQueue</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cl_context</span><span class="p">)</span> <span class="k">as</span> <span class="n">queue</span><span class="p">:</span> <span class="n">enqueue_stuff</span><span class="p">(</span><span class="n">queue</span><span class="p">,</span> <span class="o">...</span><span class="p">)</span> </pre></div> </div> <p><a class="reference internal" href="#pyopencl.CommandQueue.finish" title="pyopencl.CommandQueue.finish"><tt class="xref py py-meth docutils literal"><span class="pre">finish()</span></tt></a> is automatically called at the end of the context.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2013.1: </span>Context manager capability.</p> </div> <dl class="attribute"> <dt id="pyopencl.CommandQueue.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.CommandQueue.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">command_queue_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.CommandQueue.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.CommandQueue.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">command_queue_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.CommandQueue.set_property"> <tt class="descname">set_property</tt><big>(</big><em>prop</em>, <em>enable</em><big>)</big><a class="headerlink" href="#pyopencl.CommandQueue.set_property" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">command_queue_properties</span></tt> for possible values of <em>prop</em>. <em>enable</em> is a <a class="reference external" href="http://docs.python.org/dev/library/functions.html#bool" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">bool</span></tt></a>.</p> <p>Unavailable in OpenCL 1.1 and newer.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.CommandQueue.flush"> <tt class="descname">flush</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.CommandQueue.flush" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="pyopencl.CommandQueue.finish"> <tt class="descname">finish</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.CommandQueue.finish" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="class"> <dt id="pyopencl.Event"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Event</tt><a class="headerlink" href="#pyopencl.Event" title="Permalink to this definition">¶</a></dt> <dd><dl class="attribute"> <dt id="pyopencl.Event.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Event.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">event_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="attribute"> <dt id="pyopencl.Event.profile.info"> <tt class="descclassname">profile.</tt><tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Event.profile.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">profiling_info</span></tt> constants may be used as attributes on the attribute <cite>profile</cite> of this class to directly query profiling info.</p> <p>For example, you may use <em>evt.profile.end</em> instead of <em>evt.get_profiling_info(pyopencl.profiling_info.END)</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Event.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Event.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">event_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Event.get_profiling_info"> <tt class="descname">get_profiling_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Event.get_profiling_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">profiling_info</span></tt> for values of <em>param</em>. See <tt class="xref py py-attr docutils literal"><span class="pre">profile</span></tt> for an easier way of obtaining the same information.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Event.wait"> <tt class="descname">wait</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.Event.wait" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="function"> <dt id="pyopencl.wait_for_events"> <tt class="descclassname">pyopencl.</tt><tt class="descname">wait_for_events</tt><big>(</big><em>events</em><big>)</big><a class="headerlink" href="#pyopencl.wait_for_events" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_barrier"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_barrier</tt><big>(</big><em>queue</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_barrier" title="Permalink to this definition">¶</a></dt> <dd><p>Enqueues a barrier operation. which ensures that all queued commands in command_queue have finished execution. This command is a synchronization point.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.91.5.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.2: </span>Takes <em>wait_for</em> and returns an <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a></p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_marker"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_marker</tt><big>(</big><em>queue</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_marker" title="Permalink to this definition">¶</a></dt> <dd><p>Returns an <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a>.</p> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.2: </span>Takes <em>wait_for</em>.</p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_wait_for_events"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_wait_for_events</tt><big>(</big><em>queue</em>, <em>events</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_wait_for_events" title="Permalink to this definition">¶</a></dt> <dd><dl class="docutils"> <dt><strong>Note:</strong> This function is deprecated as of PyOpenCL 2011.2.</dt> <dd>Use <a class="reference internal" href="#pyopencl.enqueue_marker" title="pyopencl.enqueue_marker"><tt class="xref py py-func docutils literal"><span class="pre">enqueue_marker()</span></tt></a> instead.</dd> </dl> </dd></dl> <dl class="class"> <dt id="pyopencl.UserEvent"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">UserEvent</tt><big>(</big><em>context</em><big>)</big><a class="headerlink" href="#pyopencl.UserEvent" title="Permalink to this definition">¶</a></dt> <dd><p>A subclass of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a>. Only available with OpenCL 1.1 and newer.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.92.</span></p> </div> <dl class="method"> <dt id="pyopencl.UserEvent.set_status"> <tt class="descname">set_status</tt><big>(</big><em>status</em><big>)</big><a class="headerlink" href="#pyopencl.UserEvent.set_status" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">command_execution_status</span></tt> for possible values of <em>status</em>.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="pyopencl.NannyEvent"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">NannyEvent</tt><a class="headerlink" href="#pyopencl.NannyEvent" title="Permalink to this definition">¶</a></dt> <dd><p>Transfers between host and device return events of this type. They hold a reference to the host-side buffer and wait for the transfer to complete when they are freed. Therefore, they can safely release the reference to the object they’re guarding upon destruction.</p> <p>A subclass of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a>.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> <dl class="method"> <dt id="pyopencl.NannyEvent.get_ward"> <tt class="descname">get_ward</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.NannyEvent.get_ward" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="pyopencl.NannyEvent.wait"> <tt class="descname">wait</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.NannyEvent.wait" title="Permalink to this definition">¶</a></dt> <dd><p>In addition to performing the same wait as <a class="reference internal" href="#pyopencl.Event.wait" title="pyopencl.Event.wait"><tt class="xref py py-meth docutils literal"><span class="pre">Event.wait()</span></tt></a>, this method also releases the reference to the guarded object.</p> </dd></dl> </dd></dl> </div> <div class="section" id="memory"> <h2>Memory<a class="headerlink" href="#memory" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="pyopencl.MemoryObject"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">MemoryObject</tt><a class="headerlink" href="#pyopencl.MemoryObject" title="Permalink to this definition">¶</a></dt> <dd><dl class="attribute"> <dt id="pyopencl.MemoryObject.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.MemoryObject.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">mem_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="attribute"> <dt id="pyopencl.MemoryObject.hostbuf"> <tt class="descname">hostbuf</tt><a class="headerlink" href="#pyopencl.MemoryObject.hostbuf" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="pyopencl.MemoryObject.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.MemoryObject.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">mem_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.MemoryObject.release"> <tt class="descname">release</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.MemoryObject.release" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="pyopencl.MemoryObject.get_host_array"> <tt class="descname">get_host_array</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order="C"</em><big>)</big><a class="headerlink" href="#pyopencl.MemoryObject.get_host_array" title="Permalink to this definition">¶</a></dt> <dd><p>Return the memory object’s associated host memory area as a <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> of the given <em>shape</em>, <em>dtype</em> and <em>order</em>.</p> </dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_migrate_mem_objects"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_migrate_mem_objects</tt><big>(</big><em>queue</em>, <em>mem_objects</em>, <em>flags=0</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_migrate_mem_objects" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>flags</strong> – from <tt class="xref py py-class docutils literal"><span class="pre">mem_migration_flags</span></tt></td> </tr> </tbody> </table> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> <p>Only available with CL 1.2.</p> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_migrate_mem_object_ext"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_migrate_mem_object_ext</tt><big>(</big><em>queue</em>, <em>mem_objects</em>, <em>flags=0</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_migrate_mem_object_ext" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>flags</strong> – from <tt class="xref py py-class docutils literal"><span class="pre">migrate_mem_object_flags_ext</span></tt></td> </tr> </tbody> </table> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> <p>Only available with the <cite>cl_ext_migrate_memobject</cite> extension.</p> </dd></dl> <div class="section" id="buffers"> <h3>Buffers<a class="headerlink" href="#buffers" title="Permalink to this headline">¶</a></h3> <dl class="class"> <dt id="pyopencl.Buffer"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Buffer</tt><big>(</big><em>context</em>, <em>flags</em>, <em>size=0</em>, <em>hostbuf=None</em><big>)</big><a class="headerlink" href="#pyopencl.Buffer" title="Permalink to this definition">¶</a></dt> <dd><p>Create a <a class="reference internal" href="#pyopencl.Buffer" title="pyopencl.Buffer"><tt class="xref py py-class docutils literal"><span class="pre">Buffer</span></tt></a>. See <tt class="xref py py-class docutils literal"><span class="pre">mem_flags</span></tt> for values of <em>flags</em>. If <em>hostbuf</em> is specified, <em>size</em> defaults to the size of the specified buffer if it is passed as zero.</p> <p><a class="reference internal" href="#pyopencl.Buffer" title="pyopencl.Buffer"><tt class="xref py py-class docutils literal"><span class="pre">Buffer</span></tt></a> is a subclass of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a>.</p> <p>Note that actual memory allocation in OpenCL may be deferred. Buffers are attached to a <a class="reference internal" href="#pyopencl.Context" title="pyopencl.Context"><tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt></a> and are only moved to a device once the buffer is used on that device. That is also the point when out-of-memory errors will occur. If you’d like to be sure that there’s enough memory for your allocation, either use <a class="reference internal" href="#pyopencl.enqueue_migrate_mem_objects" title="pyopencl.enqueue_migrate_mem_objects"><tt class="xref py py-func docutils literal"><span class="pre">enqueue_migrate_mem_objects()</span></tt></a> (if available) or simply perform a small transfer to the buffer. See also <a class="reference internal" href="tools.html#pyopencl.tools.ImmediateAllocator" title="pyopencl.tools.ImmediateAllocator"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.tools.ImmediateAllocator</span></tt></a>.</p> <dl class="method"> <dt id="pyopencl.Buffer.get_sub_region"> <tt class="descname">get_sub_region</tt><big>(</big><em>origin</em>, <em>size</em>, <em>flags=0</em><big>)</big><a class="headerlink" href="#pyopencl.Buffer.get_sub_region" title="Permalink to this definition">¶</a></dt> <dd><p>Only available in OpenCL 1.1 and newer.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Buffer.__getitem__"> <tt class="descname">__getitem__</tt><big>(</big><em>slc</em><big>)</big><a class="headerlink" href="#pyopencl.Buffer.__getitem__" title="Permalink to this definition">¶</a></dt> <dd><p><em>slc</em> is a <a class="reference external" href="http://docs.python.org/dev/library/functions.html#slice" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">slice</span></tt></a> object indicating from which byte index range a sub-buffer is to be created. The <em>flags</em> argument of <a class="reference internal" href="#pyopencl.Buffer.get_sub_region" title="pyopencl.Buffer.get_sub_region"><tt class="xref py py-meth docutils literal"><span class="pre">get_sub_region()</span></tt></a> is set to the same flags with which <em>self</em> was created.</p> </dd></dl> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_fill_buffer"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_fill_buffer</tt><big>(</big><em>queue</em>, <em>mem</em>, <em>pattern</em>, <em>offset</em>, <em>size</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_fill_buffer" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pattern</strong> – a buffer object (likely a <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a>)</td> </tr> </tbody> </table> <p>Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> <p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> </div> <div class="section" id="image-formats"> <h3>Image Formats<a class="headerlink" href="#image-formats" title="Permalink to this headline">¶</a></h3> <dl class="class"> <dt id="pyopencl.ImageFormat"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">ImageFormat</tt><big>(</big><span class="optional">[</span><em>channel_order</em>, <em>channel_type</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#pyopencl.ImageFormat" title="Permalink to this definition">¶</a></dt> <dd><div class="versionchanged"> <p><span class="versionmodified">Changed in version 0.91: </span>Constructor arguments added.</p> </div> <dl class="attribute"> <dt id="pyopencl.ImageFormat.channel_order"> <tt class="descname">channel_order</tt><a class="headerlink" href="#pyopencl.ImageFormat.channel_order" title="Permalink to this definition">¶</a></dt> <dd><p>See <a class="reference internal" href="#pyopencl.ImageFormat.channel_order" title="pyopencl.ImageFormat.channel_order"><tt class="xref py py-class docutils literal"><span class="pre">channel_order</span></tt></a> for possible values.</p> </dd></dl> <dl class="attribute"> <dt id="pyopencl.ImageFormat.channel_data_type"> <tt class="descname">channel_data_type</tt><a class="headerlink" href="#pyopencl.ImageFormat.channel_data_type" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">channel_type</span></tt> for possible values.</p> </dd></dl> <dl class="attribute"> <dt id="pyopencl.ImageFormat.channel_count"> <tt class="descname">channel_count</tt><a class="headerlink" href="#pyopencl.ImageFormat.channel_count" title="Permalink to this definition">¶</a></dt> <dd><div class="versionadded"> <p><span class="versionmodified">New in version 0.91.5.</span></p> </div> </dd></dl> <dl class="attribute"> <dt id="pyopencl.ImageFormat.dtype_size"> <tt class="descname">dtype_size</tt><a class="headerlink" href="#pyopencl.ImageFormat.dtype_size" title="Permalink to this definition">¶</a></dt> <dd><div class="versionadded"> <p><span class="versionmodified">New in version 0.91.5.</span></p> </div> </dd></dl> <dl class="attribute"> <dt id="pyopencl.ImageFormat.itemsize"> <tt class="descname">itemsize</tt><a class="headerlink" href="#pyopencl.ImageFormat.itemsize" title="Permalink to this definition">¶</a></dt> <dd><div class="versionadded"> <p><span class="versionmodified">New in version 0.91.5.</span></p> </div> </dd></dl> <dl class="method"> <dt id="pyopencl.ImageFormat.__repr__"> <tt class="descname">__repr__</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.ImageFormat.__repr__" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#str" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a> representation of the image format.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.91.</span></p> </div> </dd></dl> </dd></dl> <dl class="function"> <dt id="pyopencl.get_supported_image_formats"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_supported_image_formats</tt><big>(</big><em>context</em>, <em>flags</em>, <em>image_type</em><big>)</big><a class="headerlink" href="#pyopencl.get_supported_image_formats" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">mem_flags</span></tt> for possible values of <em>flags</em> and <tt class="xref py py-class docutils literal"><span class="pre">mem_object_type</span></tt> for possible values of <em>image_type</em>.</p> </dd></dl> </div> <div class="section" id="images"> <h3>Images<a class="headerlink" href="#images" title="Permalink to this headline">¶</a></h3> <dl class="class"> <dt> <tt class="descname">Image(context, flags, format, shape=None, pitches=None, hostbuf=None, is_array=False, buffer=None):</tt></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">mem_flags</span></tt> for values of <em>flags</em>. <em>shape</em> is a 2- or 3-tuple. <em>format</em> is an instance of <a class="reference internal" href="#pyopencl.ImageFormat" title="pyopencl.ImageFormat"><tt class="xref py py-class docutils literal"><span class="pre">ImageFormat</span></tt></a>. <em>pitches</em> is a 1-tuple for 2D images and a 2-tuple for 3D images, indicating the distance in bytes from one scan line to the next, and from one 2D image slice to the next.</p> <p>If <em>hostbuf</em> is given and <em>shape</em> is <cite>None</cite>, then <em>hostbuf.shape</em> is used as the <em>shape</em> parameter.</p> <p><tt class="xref py py-class docutils literal"><span class="pre">Image</span></tt> is a subclass of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a>.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p>If you want to load images from <tt class="xref py py-mod docutils literal"><span class="pre">numpy.ndarray</span></tt> instances or read images back into them, be aware that OpenCL images expect the <em>x</em> dimension to vary fastest, whereas in the default (C) order of <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.8)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> arrays, the last index varies fastest. If your array is arranged in the wrong order in memory, there are two possible fixes for this:</p> <ul class="last simple"> <li>Convert the array to Fortran (column-major) order using <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.asarray.html#numpy.asarray" title="(in NumPy v1.8)"><tt class="xref py py-func docutils literal"><span class="pre">numpy.asarray()</span></tt></a>.</li> <li>Pass <em>ary.T.copy()</em> to the image creation function.</li> </ul> </div> <div class="versionadded"> <p><span class="versionmodified">New in version 0.91.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.2: </span>Added <em>is_array</em> and <em>buffer</em>, which are only available on CL 1.2 and newer.</p> </div> <dl class="attribute"> <dt id="pyopencl.info"> <tt class="descclassname">pyopencl.</tt><tt class="descname">info</tt><a class="headerlink" href="#pyopencl.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">mem_info</span></tt> and <tt class="xref py py-class docutils literal"><span class="pre">image_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="attribute"> <dt id="pyopencl.shape"> <tt class="descclassname">pyopencl.</tt><tt class="descname">shape</tt><a class="headerlink" href="#pyopencl.shape" title="Permalink to this definition">¶</a></dt> <dd><p>Return the value of the <em>shape</em> constructor argument as a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#tuple" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">tuple</span></tt></a>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.get_image_info"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_image_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.get_image_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">image_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.release"> <tt class="descclassname">pyopencl.</tt><tt class="descname">release</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.release" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="function"> <dt id="pyopencl.image_from_array"> <tt class="descclassname">pyopencl.</tt><tt class="descname">image_from_array</tt><big>(</big><em>ctx</em>, <em>ary</em>, <em>num_channels=None</em>, <em>mode="r"</em>, <em>norm_int=False</em><big>)</big><a class="headerlink" href="#pyopencl.image_from_array" title="Permalink to this definition">¶</a></dt> <dd><p>Build a 2D or 3D <tt class="xref py py-class docutils literal"><span class="pre">Image</span></tt> from the <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> <em>ary</em>. If <em>num_channels</em> is greater than one, the last dimension of <em>ary</em> must be identical to <em>num_channels</em>. <em>ary</em> must be in C order. If <em>num_channels</em> is not given, it defaults to 1 for scalar types and the number of entries for <a class="reference internal" href="array.html#vector-types"><em>Vector Types</em></a>.</p> <p>The <a class="reference internal" href="#pyopencl.ImageFormat" title="pyopencl.ImageFormat"><tt class="xref py py-class docutils literal"><span class="pre">ImageFormat</span></tt></a> is chosen as the first <em>num_channels</em> components of “RGBA”.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>mode</strong> – “r” or “w” for read/write</td> </tr> </tbody> </table> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">When reading from the image object, the indices passed to <cite>read_imagef</cite> are in the reverse order from what they would be when accessing <em>ary</em> from Python.</p> </div> <p>If <em>norm_int</em> is <cite>True</cite>, then the integer values are normalized to a floating point scale of 0..1 when read.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_fill_image"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_fill_image</tt><big>(</big><em>queue</em>, <em>mem</em>, <em>color</em>, <em>origin</em>, <em>region</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_fill_image" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>color</strong> – a buffer object (likely a <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a>)</td> </tr> </tbody> </table> <p>Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> <p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> </div> <div class="section" id="transfers"> <h3>Transfers<a class="headerlink" href="#transfers" title="Permalink to this headline">¶</a></h3> </div> <div class="section" id="mapping-memory-into-host-address-space"> <h3>Mapping Memory into Host Address Space<a class="headerlink" href="#mapping-memory-into-host-address-space" title="Permalink to this headline">¶</a></h3> <dl class="class"> <dt id="pyopencl.MemoryMap"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">MemoryMap</tt><a class="headerlink" href="#pyopencl.MemoryMap" title="Permalink to this definition">¶</a></dt> <dd><dl class="method"> <dt id="pyopencl.MemoryMap.release"> <tt class="descname">release</tt><big>(</big><em>queue=None</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.MemoryMap.release" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_map_buffer"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_map_buffer</tt><big>(</big><em>queue</em>, <em>buf</em>, <em>flags</em>, <em>offset</em>, <em>shape</em>, <em>dtype</em>, <em>order="C"</em>, <em>wait_for=None</em>, <em>is_blocking=True</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_map_buffer" title="Permalink to this definition">¶</a></dt> <dd><p><em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction. <em>shape</em>, <em>dtype</em>, and <em>order</em> have the same meaning as in <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.empty.html#numpy.empty" title="(in NumPy v1.8)"><tt class="xref py py-func docutils literal"><span class="pre">numpy.empty()</span></tt></a>. See <tt class="xref py py-class docutils literal"><span class="pre">map_flags</span></tt> for possible values of <em>flags</em>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a tuple <em>(array, event)</em>. <em>array</em> is a <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> representing the host side of the map. Its <em>.base</em> member contains a <a class="reference internal" href="#pyopencl.MemoryMap" title="pyopencl.MemoryMap"><tt class="xref py py-class docutils literal"><span class="pre">MemoryMap</span></tt></a>.</td> </tr> </tbody> </table> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.1: </span><em>is_blocking</em> now defaults to True.</p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2013.1: </span><em>order</em> now defaults to “C”.</p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_map_image"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_map_image</tt><big>(</big><em>queue</em>, <em>buf</em>, <em>flags</em>, <em>origin</em>, <em>region</em>, <em>shape</em>, <em>dtype</em>, <em>order="C"</em>, <em>wait_for=None</em>, <em>is_blocking=True</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_map_image" title="Permalink to this definition">¶</a></dt> <dd><p><em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction. <em>shape</em>, <em>dtype</em>, and <em>order</em> have the same meaning as in <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.empty.html#numpy.empty" title="(in NumPy v1.8)"><tt class="xref py py-func docutils literal"><span class="pre">numpy.empty()</span></tt></a>. See <tt class="xref py py-class docutils literal"><span class="pre">map_flags</span></tt> for possible values of <em>flags</em>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">a tuple <em>(array, event)</em>. <em>array</em> is a <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> representing the host side of the map. Its <em>.base</em> member contains a <a class="reference internal" href="#pyopencl.MemoryMap" title="pyopencl.MemoryMap"><tt class="xref py py-class docutils literal"><span class="pre">MemoryMap</span></tt></a>.</td> </tr> </tbody> </table> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.1: </span><em>is_blocking</em> now defaults to True.</p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2013.1: </span><em>order</em> now defaults to “C”.</p> </div> </dd></dl> </div> <div class="section" id="samplers"> <h3>Samplers<a class="headerlink" href="#samplers" title="Permalink to this headline">¶</a></h3> <dl class="class"> <dt id="pyopencl.Sampler"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Sampler</tt><big>(</big><em>context</em>, <em>normalized_coords</em>, <em>addressing_mode</em>, <em>filter_mode</em><big>)</big><a class="headerlink" href="#pyopencl.Sampler" title="Permalink to this definition">¶</a></dt> <dd><p><em>normalized_coords</em> is a <a class="reference external" href="http://docs.python.org/dev/library/functions.html#bool" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">bool</span></tt></a> indicating whether to use coordinates between 0 and 1 (<em>True</em>) or the texture’s natural pixel size (<em>False</em>). See <tt class="xref py py-class docutils literal"><span class="pre">addressing_mode</span></tt> and <tt class="xref py py-class docutils literal"><span class="pre">filter_mode</span></tt> for possible argument values.</p> <dl class="attribute"> <dt id="pyopencl.Sampler.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Sampler.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">sampler_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Sampler.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Sampler.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">sampler_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> </div> </div> <div class="section" id="programs-and-kernels"> <h2>Programs and Kernels<a class="headerlink" href="#programs-and-kernels" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="pyopencl.Program"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Program</tt><big>(</big><em>context</em>, <em>src</em><big>)</big><a class="headerlink" href="#pyopencl.Program" title="Permalink to this definition">¶</a></dt> <dt> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Program</tt><big>(</big><em>context</em>, <em>devices</em>, <em>binaries</em><big>)</big></dt> <dd><p><em>binaries</em> must contain one binary for each entry in <em>devices</em>.</p> <dl class="attribute"> <dt id="pyopencl.Program.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Program.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">program_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Program.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Program.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">program_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Program.get_build_info"> <tt class="descname">get_build_info</tt><big>(</big><em>device</em>, <em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Program.get_build_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">program_build_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Program.build"> <tt class="descname">build</tt><big>(</big><em>options=[]</em>, <em>devices=None</em><big>)</big><a class="headerlink" href="#pyopencl.Program.build" title="Permalink to this definition">¶</a></dt> <dd><p><em>options</em> is a string of compiler flags. Returns <em>self</em>.</p> <p>By default, built binaries are cached in an on-disk cache called <tt class="file docutils literal"><span class="pre">pyopencl-compiler-cache-vN-uidNAME-pyVERSION</span></tt> in the directory returned by <a class="reference external" href="http://docs.python.org/dev/library/tempfile.html#tempfile.gettempdir" title="(in Python v3.5)"><tt class="xref py py-func docutils literal"><span class="pre">tempfile.gettempdir()</span></tt></a>. By setting the environment variable <span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYOPENCL_NO_CACHE</span></tt> to any non-empty value, this caching is suppressed. Any options found in the environment variable <span class="target" id="index-1"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYOPENCL_BUILD_OPTIONS</span></tt> will be appened to <em>options</em>.</p> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.1: </span><em>options</em> may now also be a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#list" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">list</span></tt></a> of <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#str" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a>.</p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2013.1: </span>Added <span class="target" id="index-2"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYOPENCL_NO_CACHE</span></tt>. Added <span class="target" id="index-3"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYOPENCL_BUILD_OPTIONS</span></tt>.</p> </div> </dd></dl> <dl class="method"> <dt id="pyopencl.Program.compile"> <tt class="descname">compile</tt><big>(</big><em>self</em>, <em>options=[]</em>, <em>devices=None</em>, <em>headers=[]</em><big>)</big><a class="headerlink" href="#pyopencl.Program.compile" title="Permalink to this definition">¶</a></dt> <dd><table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>headers</strong> – a list of tuples <em>(name, program)</em>.</td> </tr> </tbody> </table> <p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> <dl class="attribute"> <dt id="pyopencl.Program.kernel_name"> <tt class="descname">kernel_name</tt><a class="headerlink" href="#pyopencl.Program.kernel_name" title="Permalink to this definition">¶</a></dt> <dd><p><a class="reference internal" href="#pyopencl.Kernel" title="pyopencl.Kernel"><tt class="xref py py-class docutils literal"><span class="pre">Kernel</span></tt></a> objects can be produced from a built (see <a class="reference internal" href="#pyopencl.Program.build" title="pyopencl.Program.build"><tt class="xref py py-meth docutils literal"><span class="pre">build()</span></tt></a>) program simply by attribute lookup.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">The <tt class="xref py py-class docutils literal"><span class="pre">program_info</span></tt> attributes live in the same name space and take precedence over <a class="reference internal" href="#pyopencl.Kernel" title="pyopencl.Kernel"><tt class="xref py py-class docutils literal"><span class="pre">Kernel</span></tt></a> names.</p> </div> </dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> <dl class="method"> <dt id="pyopencl.Program.all_kernels"> <tt class="descname">all_kernels</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.Program.all_kernels" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a list of all <a class="reference internal" href="#pyopencl.Kernel" title="pyopencl.Kernel"><tt class="xref py py-class docutils literal"><span class="pre">Kernel</span></tt></a> objects in the <a class="reference internal" href="#pyopencl.Program" title="pyopencl.Program"><tt class="xref py py-class docutils literal"><span class="pre">Program</span></tt></a>.</p> </dd></dl> </dd></dl> <dl class="function"> <dt id="pyopencl.create_program_with_built_in_kernels"> <tt class="descclassname">pyopencl.</tt><tt class="descname">create_program_with_built_in_kernels</tt><big>(</big><em>context</em>, <em>devices</em>, <em>kernel_names</em><big>)</big><a class="headerlink" href="#pyopencl.create_program_with_built_in_kernels" title="Permalink to this definition">¶</a></dt> <dd><p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.link_program"> <tt class="descclassname">pyopencl.</tt><tt class="descname">link_program</tt><big>(</big><em>context</em>, <em>programs</em>, <em>options=[]</em>, <em>devices=None</em><big>)</big><a class="headerlink" href="#pyopencl.link_program" title="Permalink to this definition">¶</a></dt> <dd><p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.unload_platform_compiler"> <tt class="descclassname">pyopencl.</tt><tt class="descname">unload_platform_compiler</tt><big>(</big><em>platform</em><big>)</big><a class="headerlink" href="#pyopencl.unload_platform_compiler" title="Permalink to this definition">¶</a></dt> <dd><p>Only available with CL 1.2.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.2.</span></p> </div> </dd></dl> <dl class="class"> <dt id="pyopencl.Kernel"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">Kernel</tt><big>(</big><em>program</em>, <em>name</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel" title="Permalink to this definition">¶</a></dt> <dd><dl class="attribute"> <dt id="pyopencl.Kernel.info"> <tt class="descname">info</tt><a class="headerlink" href="#pyopencl.Kernel.info" title="Permalink to this definition">¶</a></dt> <dd><p>Lower case versions of the <tt class="xref py py-class docutils literal"><span class="pre">kernel_info</span></tt> constants may be used as attributes on instances of this class to directly query info attributes.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.get_info"> <tt class="descname">get_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.get_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">kernel_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.get_work_group_info"> <tt class="descname">get_work_group_info</tt><big>(</big><em>param</em>, <em>device</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.get_work_group_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">kernel_work_group_info</span></tt> for values of <em>param</em>.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.get_arg_info"> <tt class="descname">get_arg_info</tt><big>(</big><em>arg_index</em>, <em>param</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.get_arg_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">kernel_arg_info</span></tt> for values of <em>param</em>.</p> <p>Only available in OpenCL 1.2 and newer.</p> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.set_arg"> <tt class="descname">set_arg</tt><big>(</big><em>self</em>, <em>index</em>, <em>arg</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.set_arg" title="Permalink to this definition">¶</a></dt> <dd><p><em>arg</em> may be</p> <ul> <li><p class="first"><cite>None</cite>: This may be passed for <cite>__global</cite> memory references to pass a NULL pointer to the kernel.</p> </li> <li><p class="first">Anything that satisfies the Python buffer interface, in particular <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a>, <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#str" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a>, or <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.8)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a>‘s sized scalars, such as <tt class="xref py py-class docutils literal"><span class="pre">numpy.int32</span></tt> or <tt class="xref py py-class docutils literal"><span class="pre">numpy.float64</span></tt>.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Note that Python’s own <a class="reference external" href="http://docs.python.org/dev/library/functions.html#int" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">int</span></tt></a> or <a class="reference external" href="http://docs.python.org/dev/library/functions.html#float" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">float</span></tt></a> objects will not work out of the box. See <a class="reference internal" href="#pyopencl.Kernel.set_scalar_arg_dtypes" title="pyopencl.Kernel.set_scalar_arg_dtypes"><tt class="xref py py-meth docutils literal"><span class="pre">Kernel.set_scalar_arg_dtypes()</span></tt></a> for a way to make them work. Alternatively, the standard library module <a class="reference external" href="http://docs.python.org/dev/library/struct.html#module-struct" title="(in Python v3.5)"><tt class="xref py py-mod docutils literal"><span class="pre">struct</span></tt></a> can be used to convert Python’s native number types to binary data in a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#str" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a>.</p> </div> </li> <li><p class="first">An instance of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a>. (e.g. <a class="reference internal" href="#pyopencl.Buffer" title="pyopencl.Buffer"><tt class="xref py py-class docutils literal"><span class="pre">Buffer</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">Image</span></tt>, etc.)</p> </li> <li><p class="first">An instance of <a class="reference internal" href="#pyopencl.LocalMemory" title="pyopencl.LocalMemory"><tt class="xref py py-class docutils literal"><span class="pre">LocalMemory</span></tt></a>.</p> </li> <li><p class="first">An instance of <a class="reference internal" href="#pyopencl.Sampler" title="pyopencl.Sampler"><tt class="xref py py-class docutils literal"><span class="pre">Sampler</span></tt></a>.</p> </li> </ul> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.set_args"> <tt class="descname">set_args</tt><big>(</big><em>self</em>, <em>*args</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.set_args" title="Permalink to this definition">¶</a></dt> <dd><p>Invoke <a class="reference internal" href="#pyopencl.Kernel.set_arg" title="pyopencl.Kernel.set_arg"><tt class="xref py py-meth docutils literal"><span class="pre">set_arg()</span></tt></a> on each element of <em>args</em> in turn.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.92.</span></p> </div> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.set_scalar_arg_dtypes"> <tt class="descname">set_scalar_arg_dtypes</tt><big>(</big><em>arg_dtypes</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.set_scalar_arg_dtypes" title="Permalink to this definition">¶</a></dt> <dd><p>Inform the wrapper about the sized types of scalar <a class="reference internal" href="#pyopencl.Kernel" title="pyopencl.Kernel"><tt class="xref py py-class docutils literal"><span class="pre">Kernel</span></tt></a> arguments. For each argument, <em>arg_dtypes</em> contains an entry. For non-scalars, this must be <em>None</em>. For scalars, it must be an object acceptable to the <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.dtype</span></tt></a> constructor, indicating that the corresponding scalar argument is of that type.</p> <p>After invoking this function with the proper information, most suitable number types will automatically be cast to the right type for kernel invocation.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p>The information set by this rountine is attached to a single kernel instance. A new kernel instance is created every time you use <cite>program.kernel</cite> attribute access. The following will therefore not work:</p> <div class="last highlight-python"><div class="highlight"><pre><span class="n">prg</span> <span class="o">=</span> <span class="n">cl</span><span class="o">.</span><span class="n">Program</span><span class="p">(</span><span class="o">...</span><span class="p">)</span><span class="o">.</span><span class="n">build</span><span class="p">()</span> <span class="n">prg</span><span class="o">.</span><span class="n">kernel</span><span class="o">.</span><span class="n">set_scalar_arg_dtypes</span><span class="p">(</span><span class="o">...</span><span class="p">)</span> <span class="n">prg</span><span class="o">.</span><span class="n">kernel</span><span class="p">(</span><span class="n">queue</span><span class="p">,</span> <span class="n">n_globals</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="n">args</span><span class="p">)</span> </pre></div> </div> </div> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.__call__"> <tt class="descname">__call__</tt><big>(</big><em>queue</em>, <em>global_size</em>, <em>local_size</em>, <em>*args</em>, <em>global_offset=None</em>, <em>wait_for=None</em>, <em>g_times_l=False</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.__call__" title="Permalink to this definition">¶</a></dt> <dd><p>Use <a class="reference internal" href="#pyopencl.enqueue_nd_range_kernel" title="pyopencl.enqueue_nd_range_kernel"><tt class="xref py py-func docutils literal"><span class="pre">enqueue_nd_range_kernel()</span></tt></a> to enqueue a kernel execution, after using <a class="reference internal" href="#pyopencl.Kernel.set_args" title="pyopencl.Kernel.set_args"><tt class="xref py py-meth docutils literal"><span class="pre">set_args()</span></tt></a> to set each argument in turn. See the documentation for <a class="reference internal" href="#pyopencl.Kernel.set_arg" title="pyopencl.Kernel.set_arg"><tt class="xref py py-meth docutils literal"><span class="pre">set_arg()</span></tt></a> to see what argument types are allowed. Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> <p><em>None</em> may be passed for local_size.</p> <p>If <em>g_times_l</em> is specified, the global size will be multiplied by the local size. (which makes the behavior more like Nvidia CUDA) In this case, <em>global_size</em> and <em>local_size</em> also do not have to have the same number of dimensions.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p><a class="reference internal" href="#pyopencl.Kernel.__call__" title="pyopencl.Kernel.__call__"><tt class="xref py py-meth docutils literal"><span class="pre">__call__()</span></tt></a> is <em>not</em> thread-safe. It sets the arguments using <a class="reference internal" href="#pyopencl.Kernel.set_args" title="pyopencl.Kernel.set_args"><tt class="xref py py-meth docutils literal"><span class="pre">set_args()</span></tt></a> and then runs <a class="reference internal" href="#pyopencl.enqueue_nd_range_kernel" title="pyopencl.enqueue_nd_range_kernel"><tt class="xref py py-func docutils literal"><span class="pre">enqueue_nd_range_kernel()</span></tt></a>. Another thread could race it in doing the same things, with undefined outcome. This issue is inherited from the C-level OpenCL API. The recommended solution is to make a kernel (i.e. access <cite>prg.kernel_name</cite>, which corresponds to making a new kernel) for every thread that may enqueue calls to the kernel.</p> <p class="last">A solution involving implicit locks was discussed and decided against on the mailing list in <a class="reference external" href="http://lists.tiker.net/pipermail/pyopencl/2012-October/001311.html">October 2012</a>.</p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 0.92: </span><em>local_size</em> was promoted to third positional argument from being a keyword argument. The old keyword argument usage will continue to be accepted with a warning throughout the 0.92 release cycle. This is a backward-compatible change (just barely!) because <em>local_size</em> as third positional argument can only be a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#tuple" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">tuple</span></tt></a> or <em>None</em>. <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#tuple" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">tuple</span></tt></a> instances are never valid <a class="reference internal" href="#pyopencl.Kernel" title="pyopencl.Kernel"><tt class="xref py py-class docutils literal"><span class="pre">Kernel</span></tt></a> arguments, and <em>None</em> is valid as an argument, but its treatment in the wrapper had a bug (now fixed) that prevented it from working.</p> </div> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.1: </span>Added the <em>g_times_l</em> keyword arg.</p> </div> </dd></dl> <dl class="method"> <dt id="pyopencl.Kernel.capture_call"> <tt class="descname">capture_call</tt><big>(</big><em>filename</em>, <em>queue</em>, <em>global_size</em>, <em>local_size</em>, <em>*args</em>, <em>global_offset=None</em>, <em>wait_for=None</em>, <em>g_times_l=False</em><big>)</big><a class="headerlink" href="#pyopencl.Kernel.capture_call" title="Permalink to this definition">¶</a></dt> <dd><p>This method supports the exact same interface as <a class="reference internal" href="#pyopencl.Kernel.__call__" title="pyopencl.Kernel.__call__"><tt class="xref py py-meth docutils literal"><span class="pre">__call__()</span></tt></a>, but instead of invoking the kernel, it writes a self-contained PyOpenCL program to <em>filename</em> that reproduces this invocation. Data and kernel source code will be packaged up in <em>filename</em>‘s source code.</p> <p>This is mainly intended as a debugging aid. For example, it can be used to automate the task of creating a small, self-contained test case for an observed problem. It can also help separate a misbehaving kernel from a potentially large or time-consuming outer code.</p> <p>To use, simply change:</p> <div class="highlight-python"><div class="highlight"><pre><span class="n">evt</span> <span class="o">=</span> <span class="n">my_kernel</span><span class="p">(</span><span class="n">queue</span><span class="p">,</span> <span class="n">gsize</span><span class="p">,</span> <span class="n">lsize</span><span class="p">,</span> <span class="n">arg1</span><span class="p">,</span> <span class="n">arg2</span><span class="p">,</span> <span class="o">...</span><span class="p">)</span> </pre></div> </div> <p>to:</p> <div class="highlight-python"><div class="highlight"><pre><span class="n">evt</span> <span class="o">=</span> <span class="n">my_kernel</span><span class="o">.</span><span class="n">capture_call</span><span class="p">(</span><span class="s">"bug.py"</span><span class="p">,</span> <span class="n">queue</span><span class="p">,</span> <span class="n">gsize</span><span class="p">,</span> <span class="n">lsize</span><span class="p">,</span> <span class="n">arg1</span><span class="p">,</span> <span class="n">arg2</span><span class="p">,</span> <span class="o">...</span><span class="p">)</span> </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified">New in version 2013.1.</span></p> </div> </dd></dl> <p>Instances of this class are hashable, and two instances of this class may be compared using <em>“==”</em> and <em>”!=”</em>. (Hashability was added in version 2011.2.)</p> </dd></dl> <dl class="class"> <dt id="pyopencl.LocalMemory"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">LocalMemory</tt><big>(</big><em>size</em><big>)</big><a class="headerlink" href="#pyopencl.LocalMemory" title="Permalink to this definition">¶</a></dt> <dd><p>A helper class to pass <cite>__local</cite> memory arguments to kernels.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.91.2.</span></p> </div> <dl class="attribute"> <dt id="pyopencl.LocalMemory.size"> <tt class="descname">size</tt><a class="headerlink" href="#pyopencl.LocalMemory.size" title="Permalink to this definition">¶</a></dt> <dd><p>The size of local buffer in bytes to be provided.</p> </dd></dl> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_nd_range_kernel"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_nd_range_kernel</tt><big>(</big><em>queue</em>, <em>kernel</em>, <em>global_work_size</em>, <em>local_work_size</em>, <em>global_work_offset=None</em>, <em>wait_for=None</em>, <em>g_times_l=False</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_nd_range_kernel" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> <p>If <em>g_times_l</em> is specified, the global size will be multiplied by the local size. (which makes the behavior more like Nvidia CUDA) In this case, <em>global_size</em> and <em>local_size</em> also do not have to have the same number of dimensions.</p> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.1: </span>Added the <em>g_times_l</em> keyword arg.</p> </div> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_task"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_task</tt><big>(</big><em>queue</em>, <em>kernel</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_task" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> </dd></dl> </div> <div class="section" id="gl-interoperability"> <span id="gl-interop"></span><h2>GL Interoperability<a class="headerlink" href="#gl-interoperability" title="Permalink to this headline">¶</a></h2> <p>Functionality in this section is only available when PyOpenCL is compiled with GL support. See <a class="reference internal" href="#pyopencl.have_gl" title="pyopencl.have_gl"><tt class="xref py py-func docutils literal"><span class="pre">have_gl()</span></tt></a>.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.91.</span></p> </div> <dl class="function"> <dt id="pyopencl.have_gl"> <tt class="descclassname">pyopencl.</tt><tt class="descname">have_gl</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.have_gl" title="Permalink to this definition">¶</a></dt> <dd><p>Return <em>True</em> if PyOpenCL was compiled with OpenGL interoperability, otherwise <em>False</em>.</p> </dd></dl> <dl class="function"> <dt id="pyopencl.get_gl_sharing_context_properties"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_gl_sharing_context_properties</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.get_gl_sharing_context_properties" title="Permalink to this definition">¶</a></dt> <dd><p>Return a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#list" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">list</span></tt></a> of <tt class="xref py py-class docutils literal"><span class="pre">context_properties</span></tt> that will allow a newly created context to share the currently active GL context.</p> </dd></dl> <dl class="function"> <dt id="pyopencl.get_apple_cgl_share_group"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_apple_cgl_share_group</tt><big>(</big><big>)</big><a class="headerlink" href="#pyopencl.get_apple_cgl_share_group" title="Permalink to this definition">¶</a></dt> <dd><p>Get share group handle for current CGL context.</p> <p>Apple OS X only.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 2011.1.</span></p> </div> </dd></dl> <dl class="class"> <dt id="pyopencl.GLBuffer"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">GLBuffer</tt><big>(</big><em>context</em>, <em>flags</em>, <em>bufobj</em><big>)</big><a class="headerlink" href="#pyopencl.GLBuffer" title="Permalink to this definition">¶</a></dt> <dd><p><a class="reference internal" href="#pyopencl.GLBuffer" title="pyopencl.GLBuffer"><tt class="xref py py-class docutils literal"><span class="pre">GLBuffer</span></tt></a> is a subclass of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a>.</p> <dl class="attribute"> <dt id="pyopencl.GLBuffer.gl_object"> <tt class="descname">gl_object</tt><a class="headerlink" href="#pyopencl.GLBuffer.gl_object" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> <dl class="class"> <dt id="pyopencl.GLRenderBuffer"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">GLRenderBuffer</tt><big>(</big><em>context</em>, <em>flags</em>, <em>bufobj</em><big>)</big><a class="headerlink" href="#pyopencl.GLRenderBuffer" title="Permalink to this definition">¶</a></dt> <dd><p><a class="reference internal" href="#pyopencl.GLRenderBuffer" title="pyopencl.GLRenderBuffer"><tt class="xref py py-class docutils literal"><span class="pre">GLRenderBuffer</span></tt></a> is a subclass of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a>.</p> <dl class="attribute"> <dt id="pyopencl.GLRenderBuffer.gl_object"> <tt class="descname">gl_object</tt><a class="headerlink" href="#pyopencl.GLRenderBuffer.gl_object" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> <dl class="class"> <dt id="pyopencl.GLTexture"> <em class="property">class </em><tt class="descclassname">pyopencl.</tt><tt class="descname">GLTexture</tt><big>(</big><em>context</em>, <em>flags</em>, <em>texture_target</em>, <em>miplevel</em>, <em>texture</em>, <em>dims</em><big>)</big><a class="headerlink" href="#pyopencl.GLTexture" title="Permalink to this definition">¶</a></dt> <dd><p><em>dims</em> is either 2 or 3. <a class="reference internal" href="#pyopencl.GLTexture" title="pyopencl.GLTexture"><tt class="xref py py-class docutils literal"><span class="pre">GLTexture</span></tt></a> is a subclass of <tt class="xref py py-class docutils literal"><span class="pre">Image</span></tt>.</p> <dl class="attribute"> <dt id="pyopencl.GLTexture.gl_object"> <tt class="descname">gl_object</tt><a class="headerlink" href="#pyopencl.GLTexture.gl_object" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="pyopencl.GLTexture.get_gl_texture_info"> <tt class="descname">get_gl_texture_info</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#pyopencl.GLTexture.get_gl_texture_info" title="Permalink to this definition">¶</a></dt> <dd><p>See <tt class="xref py py-class docutils literal"><span class="pre">gl_texture_info</span></tt> for values of <em>param</em>. Only available when PyOpenCL is compiled with GL support. See <a class="reference internal" href="#pyopencl.have_gl" title="pyopencl.have_gl"><tt class="xref py py-func docutils literal"><span class="pre">have_gl()</span></tt></a>.</p> </dd></dl> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_acquire_gl_objects"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_acquire_gl_objects</tt><big>(</big><em>queue</em>, <em>mem_objects</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_acquire_gl_objects" title="Permalink to this definition">¶</a></dt> <dd><p><em>mem_objects</em> is a list of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a> instances. Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> </dd></dl> <dl class="function"> <dt id="pyopencl.enqueue_release_gl_objects"> <tt class="descclassname">pyopencl.</tt><tt class="descname">enqueue_release_gl_objects</tt><big>(</big><em>queue</em>, <em>mem_objects</em>, <em>wait_for=None</em><big>)</big><a class="headerlink" href="#pyopencl.enqueue_release_gl_objects" title="Permalink to this definition">¶</a></dt> <dd><p><em>mem_objects</em> is a list of <a class="reference internal" href="#pyopencl.MemoryObject" title="pyopencl.MemoryObject"><tt class="xref py py-class docutils literal"><span class="pre">MemoryObject</span></tt></a> instances. Returns a new <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a>. <em>wait_for</em> may either be <em>None</em> or a list of <a class="reference internal" href="#pyopencl.Event" title="pyopencl.Event"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.Event</span></tt></a> instances for whose completion this command waits before starting exeuction.</p> </dd></dl> <dl class="function"> <dt id="pyopencl.get_gl_context_info_khr"> <tt class="descclassname">pyopencl.</tt><tt class="descname">get_gl_context_info_khr</tt><big>(</big><em>properties</em>, <em>param_name</em>, <em>platform=None</em><big>)</big><a class="headerlink" href="#pyopencl.get_gl_context_info_khr" title="Permalink to this definition">¶</a></dt> <dd><p>Get information on which CL device corresponds to a given GL/EGL/WGL/CGL device.</p> <p>See the <a class="reference internal" href="#pyopencl.Context" title="pyopencl.Context"><tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt></a> constructor for the meaning of <em>properties</em> and <tt class="xref py py-class docutils literal"><span class="pre">gl_context_info</span></tt> for <em>param_name</em>.</p> <div class="versionchanged"> <p><span class="versionmodified">Changed in version 2011.2: </span>Accepts the <em>platform</em> argument. Using <em>platform</em> equal to None is deprecated as of PyOpenCL 2011.2.</p> </div> </dd></dl> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">OpenCL Runtime</a><ul> <li><a class="reference internal" href="#module-pyopencl">Version Queries</a></li> <li><a class="reference internal" href="#error-reporting">Error Reporting</a></li> <li><a class="reference internal" href="#constants">Constants</a></li> <li><a class="reference internal" href="#platforms-devices-and-contexts">Platforms, Devices and Contexts</a></li> <li><a class="reference internal" href="#command-queues-and-events">Command Queues and Events</a></li> <li><a class="reference internal" href="#memory">Memory</a><ul> <li><a class="reference internal" href="#buffers">Buffers</a></li> <li><a class="reference internal" href="#image-formats">Image Formats</a></li> <li><a class="reference internal" href="#images">Images</a></li> <li><a class="reference internal" href="#transfers">Transfers</a></li> <li><a class="reference internal" href="#mapping-memory-into-host-address-space">Mapping Memory into Host Address Space</a></li> <li><a class="reference internal" href="#samplers">Samplers</a></li> </ul> </li> <li><a class="reference internal" href="#programs-and-kernels">Programs and Kernels</a></li> <li><a class="reference internal" href="#gl-interoperability">GL Interoperability</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="index.html" title="previous chapter">Welcome to PyOpenCL’s documentation!</a></p> <h4>Next topic</h4> <p class="topless"><a href="array.html" title="next chapter">Multi-dimensional arrays</a></p> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="array.html" title="Multi-dimensional arrays" >next</a> |</li> <li class="right" > <a href="index.html" title="Welcome to PyOpenCL’s documentation!" >previous</a> |</li> <li><a href="index.html">PyOpenCL 2013.1 documentation</a> »</li> </ul> </div> <div class="footer"> © Copyright 2009, Andreas Kloeckner. Last updated on Oct 15, 2014. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. </div> </body> </html>