Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > nonfree-release > by-pkgid > 9e74824375d82b5e6c4b187b256e94f6 > files > 135

python-pycuda-2014.1-6.mga5.nonfree.x86_64.rpm

<!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>Device Interface &mdash; PyCUDA 2014.1 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2014.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </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="PyCUDA 2014.1 documentation" href="index.html" />
    <link rel="next" title="Built-in Utilities" href="util.html" />
    <link rel="prev" title="Tutorial" href="tutorial.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="util.html" title="Built-in Utilities"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="tutorial.html" title="Tutorial"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">PyCUDA 2014.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pycuda">
<span id="device-interface"></span><span id="reference-doc"></span><h1>Device Interface<a class="headerlink" href="#module-pycuda" title="Permalink to this headline">¶</a></h1>
<div class="section" id="version-queries">
<h2>Version Queries<a class="headerlink" href="#version-queries" title="Permalink to this headline">¶</a></h2>
<dl class="data">
<dt id="pycuda.VERSION">
<tt class="descclassname">pycuda.</tt><tt class="descname">VERSION</tt><a class="headerlink" href="#pycuda.VERSION" title="Permalink to this definition">¶</a></dt>
<dd><p>Gives the numeric version of PyCUDA as a variable-length tuple
of integers. Enables easy version checks such as
<em>VERSION &gt;= (0, 93)</em>.</p>
<p>Added in PyCUDA 0.93.</p>
</dd></dl>

<dl class="data">
<dt id="pycuda.VERSION_STATUS">
<tt class="descclassname">pycuda.</tt><tt class="descname">VERSION_STATUS</tt><a class="headerlink" href="#pycuda.VERSION_STATUS" title="Permalink to this definition">¶</a></dt>
<dd><p>A text string such as <cite>&#8220;rc4&#8221;</cite> or <cite>&#8220;beta&#8221;</cite> qualifying the status
of the release.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.93.</span></p>
</div>
</dd></dl>

<dl class="data">
<dt id="pycuda.VERSION_TEXT">
<tt class="descclassname">pycuda.</tt><tt class="descname">VERSION_TEXT</tt><a class="headerlink" href="#pycuda.VERSION_TEXT" title="Permalink to this definition">¶</a></dt>
<dd><p>The full release name (such as <cite>&#8220;0.93rc4&#8221;</cite>) in string form.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.93.</span></p>
</div>
</dd></dl>

<span class="target" id="module-pycuda.driver"></span></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="exception">
<dt id="pycuda.driver.Error">
<em class="property">exception </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Error</tt><a class="headerlink" href="#pycuda.driver.Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class of all PyCuda errors.</p>
</dd></dl>

<dl class="exception">
<dt id="pycuda.driver.CompileError">
<em class="property">exception </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">CompileError</tt><a class="headerlink" href="#pycuda.driver.CompileError" title="Permalink to this definition">¶</a></dt>
<dd><p>Thrown when <a class="reference internal" href="#pycuda.compiler.SourceModule" title="pycuda.compiler.SourceModule"><tt class="xref py py-class docutils literal"><span class="pre">pycuda.compiler.SourceModule</span></tt></a> compilation fails.</p>
<dl class="attribute">
<dt id="pycuda.driver.CompileError.msg">
<tt class="descname">msg</tt><a class="headerlink" href="#pycuda.driver.CompileError.msg" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.CompileError.stdout">
<tt class="descname">stdout</tt><a class="headerlink" href="#pycuda.driver.CompileError.stdout" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.CompileError.stderr">
<tt class="descname">stderr</tt><a class="headerlink" href="#pycuda.driver.CompileError.stderr" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.CompileError.command_line">
<tt class="descname">command_line</tt><a class="headerlink" href="#pycuda.driver.CompileError.command_line" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="pycuda.driver.MemoryError">
<em class="property">exception </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">MemoryError</tt><a class="headerlink" href="#pycuda.driver.MemoryError" title="Permalink to this definition">¶</a></dt>
<dd><p>Thrown when <a class="reference internal" href="#pycuda.driver.mem_alloc" title="pycuda.driver.mem_alloc"><tt class="xref py py-func docutils literal"><span class="pre">mem_alloc()</span></tt></a> or related functionality fails.</p>
</dd></dl>

<dl class="exception">
<dt id="pycuda.driver.LogicError">
<em class="property">exception </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">LogicError</tt><a class="headerlink" href="#pycuda.driver.LogicError" title="Permalink to this definition">¶</a></dt>
<dd><p>Thrown when PyCuda was confronted with a situation where it is likely
that the programmer has made a mistake. <tt class="xref py py-exc docutils literal"><span class="pre">LogicErrors</span></tt> do not depend
on outer circumstances defined by the run-time environment.</p>
<p>Example: CUDA was used before it was initialized.</p>
</dd></dl>

<dl class="exception">
<dt id="pycuda.driver.LaunchError">
<em class="property">exception </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">LaunchError</tt><a class="headerlink" href="#pycuda.driver.LaunchError" title="Permalink to this definition">¶</a></dt>
<dd><p>Thrown when kernel invocation has failed. (Note that this will often be
reported by the next call after the actual kernel invocation.)</p>
</dd></dl>

<dl class="exception">
<dt id="pycuda.driver.RuntimeError">
<em class="property">exception </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">RuntimeError</tt><a class="headerlink" href="#pycuda.driver.RuntimeError" title="Permalink to this definition">¶</a></dt>
<dd><p>Thrown when a unforeseen run-time failure is encountered that is not
likely due to programmer error.</p>
<p>Example: A file was not found.</p>
</dd></dl>

</div>
<div class="section" id="constants">
<h2>Constants<a class="headerlink" href="#constants" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pycuda.driver.ctx_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">ctx_flags</tt><a class="headerlink" href="#pycuda.driver.ctx_flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Flags for <a class="reference internal" href="#pycuda.driver.Device.make_context" title="pycuda.driver.Device.make_context"><tt class="xref py py-meth docutils literal"><span class="pre">Device.make_context()</span></tt></a>. CUDA 2.0 and above only.</p>
<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.SCHED_AUTO">
<tt class="descname">SCHED_AUTO</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.SCHED_AUTO" title="Permalink to this definition">¶</a></dt>
<dd><p>If there are more contexts than processors, yield, otherwise spin
while waiting for CUDA calls to complete.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.SCHED_SPIN">
<tt class="descname">SCHED_SPIN</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.SCHED_SPIN" title="Permalink to this definition">¶</a></dt>
<dd><p>Spin while waiting for CUDA calls to complete.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.SCHED_YIELD">
<tt class="descname">SCHED_YIELD</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.SCHED_YIELD" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield to other threads while waiting for CUDA calls to complete.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.SCHED_MASK">
<tt class="descname">SCHED_MASK</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.SCHED_MASK" title="Permalink to this definition">¶</a></dt>
<dd><p>Mask of valid scheduling flags in this bitfield.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.SCHED_BLOCKING_SYNC">
<tt class="descname">SCHED_BLOCKING_SYNC</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.SCHED_BLOCKING_SYNC" title="Permalink to this definition">¶</a></dt>
<dd><p>Use blocking synchronization. CUDA 2.2 and newer.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.MAP_HOST">
<tt class="descname">MAP_HOST</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.MAP_HOST" title="Permalink to this definition">¶</a></dt>
<dd><p>Support mapped pinned allocations. CUDA 2.2 and newer.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.LMEM_RESIZE_TO_MAX">
<tt class="descname">LMEM_RESIZE_TO_MAX</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.LMEM_RESIZE_TO_MAX" title="Permalink to this definition">¶</a></dt>
<dd><p>Keep local memory allocation after launch. CUDA 3.2 and newer.
Rumored to decrease Fermi launch overhead?</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ctx_flags.FLAGS_MASK">
<tt class="descname">FLAGS_MASK</tt><a class="headerlink" href="#pycuda.driver.ctx_flags.FLAGS_MASK" title="Permalink to this definition">¶</a></dt>
<dd><p>Mask of valid flags in this bitfield.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.event_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">event_flags</tt><a class="headerlink" href="#pycuda.driver.event_flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Flags for <a class="reference internal" href="#pycuda.driver.Event" title="pycuda.driver.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a>. CUDA 2.2 and newer.</p>
<dl class="attribute">
<dt id="pycuda.driver.event_flags.DEFAULT">
<tt class="descname">DEFAULT</tt><a class="headerlink" href="#pycuda.driver.event_flags.DEFAULT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.event_flags.BLOCKING_SYNC">
<tt class="descname">BLOCKING_SYNC</tt><a class="headerlink" href="#pycuda.driver.event_flags.BLOCKING_SYNC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.event_flags.DISABLE_TIMING">
<tt class="descname">DISABLE_TIMING</tt><a class="headerlink" href="#pycuda.driver.event_flags.DISABLE_TIMING" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.event_flags.INTERPROCESS">
<tt class="descname">INTERPROCESS</tt><a class="headerlink" href="#pycuda.driver.event_flags.INTERPROCESS" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.1 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.device_attribute">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">device_attribute</tt><a class="headerlink" href="#pycuda.driver.device_attribute" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_THREADS_PER_BLOCK">
<tt class="descname">MAX_THREADS_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_THREADS_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_BLOCK_DIM_X">
<tt class="descname">MAX_BLOCK_DIM_X</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_BLOCK_DIM_X" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_BLOCK_DIM_Y">
<tt class="descname">MAX_BLOCK_DIM_Y</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_BLOCK_DIM_Y" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_BLOCK_DIM_Z">
<tt class="descname">MAX_BLOCK_DIM_Z</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_BLOCK_DIM_Z" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_GRID_DIM_X">
<tt class="descname">MAX_GRID_DIM_X</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_GRID_DIM_X" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_GRID_DIM_Y">
<tt class="descname">MAX_GRID_DIM_Y</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_GRID_DIM_Y" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_GRID_DIM_Z">
<tt class="descname">MAX_GRID_DIM_Z</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_GRID_DIM_Z" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.TOTAL_CONSTANT_MEMORY">
<tt class="descname">TOTAL_CONSTANT_MEMORY</tt><a class="headerlink" href="#pycuda.driver.device_attribute.TOTAL_CONSTANT_MEMORY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.WARP_SIZE">
<tt class="descname">WARP_SIZE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.WARP_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_PITCH">
<tt class="descname">MAX_PITCH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_PITCH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.CLOCK_RATE">
<tt class="descname">CLOCK_RATE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.CLOCK_RATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.TEXTURE_ALIGNMENT">
<tt class="descname">TEXTURE_ALIGNMENT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.TEXTURE_ALIGNMENT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.GPU_OVERLAP">
<tt class="descname">GPU_OVERLAP</tt><a class="headerlink" href="#pycuda.driver.device_attribute.GPU_OVERLAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MULTIPROCESSOR_COUNT">
<tt class="descname">MULTIPROCESSOR_COUNT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MULTIPROCESSOR_COUNT" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.0 and above only.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.SHARED_MEMORY_PER_BLOCK">
<tt class="descname">SHARED_MEMORY_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.device_attribute.SHARED_MEMORY_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd><p>Deprecated as of CUDA 2.0. See below for replacement.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_SHARED_MEMORY_PER_BLOCK">
<tt class="descname">MAX_SHARED_MEMORY_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_SHARED_MEMORY_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.0 and above only.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.REGISTERS_PER_BLOCK">
<tt class="descname">REGISTERS_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.device_attribute.REGISTERS_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd><p>Deprecated as of CUDA 2.0. See below for replacement.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAX_REGISTERS_PER_BLOCK">
<tt class="descname">MAX_REGISTERS_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_REGISTERS_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.0 and above.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.KERNEL_EXEC_TIMEOUT">
<tt class="descname">KERNEL_EXEC_TIMEOUT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.KERNEL_EXEC_TIMEOUT" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.2 and above.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.INTEGRATED">
<tt class="descname">INTEGRATED</tt><a class="headerlink" href="#pycuda.driver.device_attribute.INTEGRATED" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.2 and above.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.CAN_MAP_HOST_MEMORY">
<tt class="descname">CAN_MAP_HOST_MEMORY</tt><a class="headerlink" href="#pycuda.driver.device_attribute.CAN_MAP_HOST_MEMORY" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.2 and above.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.COMPUTE_MODE">
<tt class="descname">COMPUTE_MODE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.COMPUTE_MODE" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.2 and above. See <a class="reference internal" href="#pycuda.driver.compute_mode" title="pycuda.driver.compute_mode"><tt class="xref py py-class docutils literal"><span class="pre">compute_mode</span></tt></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE1D_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE2D_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE2D_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE3D_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE3D_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_DEPTH">
<tt class="descname">MAXIMUM_TEXTURE3D_DEPTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_DEPTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_ARRAY_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE2D_ARRAY_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_ARRAY_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_ARRAY_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE2D_ARRAY_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_ARRAY_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES">
<tt class="descname">MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LAYERED_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE2D_LAYERED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LAYERED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LAYERED_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE2D_LAYERED_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LAYERED_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LAYERED_LAYERS">
<tt class="descname">MAXIMUM_TEXTURE2D_LAYERED_LAYERS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LAYERED_LAYERS" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_LAYERED_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE1D_LAYERED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_LAYERED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_LAYERED_LAYERS">
<tt class="descname">MAXIMUM_TEXTURE1D_LAYERED_LAYERS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_LAYERED_LAYERS" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.SURFACE_ALIGNMENT">
<tt class="descname">SURFACE_ALIGNMENT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.SURFACE_ALIGNMENT" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 (post-beta) and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.CONCURRENT_KERNELS">
<tt class="descname">CONCURRENT_KERNELS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.CONCURRENT_KERNELS" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 (post-beta) and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.ECC_ENABLED">
<tt class="descname">ECC_ENABLED</tt><a class="headerlink" href="#pycuda.driver.device_attribute.ECC_ENABLED" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 (post-beta) and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.PCI_BUS_ID">
<tt class="descname">PCI_BUS_ID</tt><a class="headerlink" href="#pycuda.driver.device_attribute.PCI_BUS_ID" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.PCI_DEVICE_ID">
<tt class="descname">PCI_DEVICE_ID</tt><a class="headerlink" href="#pycuda.driver.device_attribute.PCI_DEVICE_ID" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.TCC_DRIVER">
<tt class="descname">TCC_DRIVER</tt><a class="headerlink" href="#pycuda.driver.device_attribute.TCC_DRIVER" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MEMORY_CLOCK_RATE">
<tt class="descname">MEMORY_CLOCK_RATE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MEMORY_CLOCK_RATE" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.GLOBAL_MEMORY_BUS_WIDTH">
<tt class="descname">GLOBAL_MEMORY_BUS_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.GLOBAL_MEMORY_BUS_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.L2_CACHE_SIZE">
<tt class="descname">L2_CACHE_SIZE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.L2_CACHE_SIZE" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAX_THREADS_PER_MULTIPROCESSOR">
<tt class="descname">MAX_THREADS_PER_MULTIPROCESSOR</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_THREADS_PER_MULTIPROCESSOR" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.ASYNC_ENGINE_COUNT">
<tt class="descname">ASYNC_ENGINE_COUNT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.ASYNC_ENGINE_COUNT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.UNIFIED_ADDRESSING">
<tt class="descname">UNIFIED_ADDRESSING</tt><a class="headerlink" href="#pycuda.driver.device_attribute.UNIFIED_ADDRESSING" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_GATHER_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE2D_GATHER_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_GATHER_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_GATHER_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE2D_GATHER_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_GATHER_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE">
<tt class="descname">MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE">
<tt class="descname">MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE">
<tt class="descname">MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.PCI_DOMAIN_ID">
<tt class="descname">PCI_DOMAIN_ID</tt><a class="headerlink" href="#pycuda.driver.device_attribute.PCI_DOMAIN_ID" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.TEXTURE_PITCH_ALIGNMENT">
<tt class="descname">TEXTURE_PITCH_ALIGNMENT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.TEXTURE_PITCH_ALIGNMENT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURECUBEMAP_WIDTH">
<tt class="descname">MAXIMUM_TEXTURECUBEMAP_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURECUBEMAP_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH">
<tt class="descname">MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS">
<tt class="descname">MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE1D_WIDTH">
<tt class="descname">MAXIMUM_SURFACE1D_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE1D_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_WIDTH">
<tt class="descname">MAXIMUM_SURFACE2D_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_HEIGHT">
<tt class="descname">MAXIMUM_SURFACE2D_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE3D_WIDTH">
<tt class="descname">MAXIMUM_SURFACE3D_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE3D_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE3D_HEIGHT">
<tt class="descname">MAXIMUM_SURFACE3D_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE3D_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE3D_DEPTH">
<tt class="descname">MAXIMUM_SURFACE3D_DEPTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE3D_DEPTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE1D_LAYERED_WIDTH">
<tt class="descname">MAXIMUM_SURFACE1D_LAYERED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE1D_LAYERED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE1D_LAYERED_LAYERS">
<tt class="descname">MAXIMUM_SURFACE1D_LAYERED_LAYERS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE1D_LAYERED_LAYERS" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_LAYERED_WIDTH">
<tt class="descname">MAXIMUM_SURFACE2D_LAYERED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_LAYERED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_LAYERED_HEIGHT">
<tt class="descname">MAXIMUM_SURFACE2D_LAYERED_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_LAYERED_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_LAYERED_LAYERS">
<tt class="descname">MAXIMUM_SURFACE2D_LAYERED_LAYERS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACE2D_LAYERED_LAYERS" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACECUBEMAP_WIDTH">
<tt class="descname">MAXIMUM_SURFACECUBEMAP_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACECUBEMAP_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH">
<tt class="descname">MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS">
<tt class="descname">MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_LINEAR_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE1D_LINEAR_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_LINEAR_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LINEAR_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE2D_LINEAR_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LINEAR_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LINEAR_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE2D_LINEAR_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LINEAR_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LINEAR_PITCH">
<tt class="descname">MAXIMUM_TEXTURE2D_LINEAR_PITCH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_LINEAR_PITCH" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT">
<tt class="descname">MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.COMPUTE_CAPABILITY_MAJOR">
<tt class="descname">COMPUTE_CAPABILITY_MAJOR</tt><a class="headerlink" href="#pycuda.driver.device_attribute.COMPUTE_CAPABILITY_MAJOR" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.COMPUTE_CAPABILITY_MINOR">
<tt class="descname">COMPUTE_CAPABILITY_MINOR</tt><a class="headerlink" href="#pycuda.driver.device_attribute.COMPUTE_CAPABILITY_MINOR" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH">
<tt class="descname">MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 5.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.STREAM_PRIORITIES_SUPPORTED">
<tt class="descname">STREAM_PRIORITIES_SUPPORTED</tt><a class="headerlink" href="#pycuda.driver.device_attribute.STREAM_PRIORITIES_SUPPORTED" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 5.5 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.device_attribute.GLOBAL_L1_CACHE_SUPPORTED">
<tt class="descname">GLOBAL_L1_CACHE_SUPPORTED</tt><a class="headerlink" href="#pycuda.driver.device_attribute.GLOBAL_L1_CACHE_SUPPORTED" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.LOCAL_L1_CACHE_SUPPORTED">
<tt class="descname">LOCAL_L1_CACHE_SUPPORTED</tt><a class="headerlink" href="#pycuda.driver.device_attribute.LOCAL_L1_CACHE_SUPPORTED" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAX_SHARED_MEMORY_PER_MULTIPROCESSOR">
<tt class="descname">MAX_SHARED_MEMORY_PER_MULTIPROCESSOR</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_SHARED_MEMORY_PER_MULTIPROCESSOR" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MAX_REGISTERS_PER_MULTIPROCESSOR">
<tt class="descname">MAX_REGISTERS_PER_MULTIPROCESSOR</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MAX_REGISTERS_PER_MULTIPROCESSOR" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MANAGED_MEMORY">
<tt class="descname">MANAGED_MEMORY</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MANAGED_MEMORY" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MULTI_GPU_BOARD">
<tt class="descname">MULTI_GPU_BOARD</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MULTI_GPU_BOARD" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.device_attribute.MULTI_GPU_BOARD_GROUP_ID">
<tt class="descname">MULTI_GPU_BOARD_GROUP_ID</tt><a class="headerlink" href="#pycuda.driver.device_attribute.MULTI_GPU_BOARD_GROUP_ID" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 6.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.pointer_attribute">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">pointer_attribute</tt><a class="headerlink" href="#pycuda.driver.pointer_attribute" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.pointer_attribute.CONTEXT">
<tt class="descname">CONTEXT</tt><a class="headerlink" href="#pycuda.driver.pointer_attribute.CONTEXT" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.pointer_attribute.MEMORY_TYPE">
<tt class="descname">MEMORY_TYPE</tt><a class="headerlink" href="#pycuda.driver.pointer_attribute.MEMORY_TYPE" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.pointer_attribute.DEVICE_POINTER">
<tt class="descname">DEVICE_POINTER</tt><a class="headerlink" href="#pycuda.driver.pointer_attribute.DEVICE_POINTER" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.pointer_attribute.HOST_POINTER">
<tt class="descname">HOST_POINTER</tt><a class="headerlink" href="#pycuda.driver.pointer_attribute.HOST_POINTER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.profiler_output_mode">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">profiler_output_mode</tt><a class="headerlink" href="#pycuda.driver.profiler_output_mode" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.profiler_output_mode.KEY_VALUE_PAIR">
<tt class="descname">KEY_VALUE_PAIR</tt><a class="headerlink" href="#pycuda.driver.profiler_output_mode.KEY_VALUE_PAIR" title="Permalink to this definition">¶</a></dt>
<dt id="pycuda.driver.profiler_output_mode.CSV">
<tt class="descname">CSV</tt><a class="headerlink" href="#pycuda.driver.profiler_output_mode.CSV" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.function_attribute">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">function_attribute</tt><a class="headerlink" href="#pycuda.driver.function_attribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Flags for <a class="reference internal" href="#pycuda.driver.Function.get_attribute" title="pycuda.driver.Function.get_attribute"><tt class="xref py py-meth docutils literal"><span class="pre">Function.get_attribute()</span></tt></a>. CUDA 2.2 and newer.</p>
<dl class="attribute">
<dt id="pycuda.driver.function_attribute.MAX_THREADS_PER_BLOCK">
<tt class="descname">MAX_THREADS_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.function_attribute.MAX_THREADS_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.SHARED_SIZE_BYTES">
<tt class="descname">SHARED_SIZE_BYTES</tt><a class="headerlink" href="#pycuda.driver.function_attribute.SHARED_SIZE_BYTES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.CONST_SIZE_BYTES">
<tt class="descname">CONST_SIZE_BYTES</tt><a class="headerlink" href="#pycuda.driver.function_attribute.CONST_SIZE_BYTES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.LOCAL_SIZE_BYTES">
<tt class="descname">LOCAL_SIZE_BYTES</tt><a class="headerlink" href="#pycuda.driver.function_attribute.LOCAL_SIZE_BYTES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.NUM_REGS">
<tt class="descname">NUM_REGS</tt><a class="headerlink" href="#pycuda.driver.function_attribute.NUM_REGS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.PTX_VERSION">
<tt class="descname">PTX_VERSION</tt><a class="headerlink" href="#pycuda.driver.function_attribute.PTX_VERSION" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 (post-beta) and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.BINARY_VERSION">
<tt class="descname">BINARY_VERSION</tt><a class="headerlink" href="#pycuda.driver.function_attribute.BINARY_VERSION" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 (post-beta) and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.function_attribute.MAX">
<tt class="descname">MAX</tt><a class="headerlink" href="#pycuda.driver.function_attribute.MAX" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.func_cache">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">func_cache</tt><a class="headerlink" href="#pycuda.driver.func_cache" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.Function.set_cache_config" title="pycuda.driver.Function.set_cache_config"><tt class="xref py py-meth docutils literal"><span class="pre">Function.set_cache_config()</span></tt></a>. CUDA 3.0 (post-beta) and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
<dl class="attribute">
<dt id="pycuda.driver.func_cache.PREFER_NONE">
<tt class="descname">PREFER_NONE</tt><a class="headerlink" href="#pycuda.driver.func_cache.PREFER_NONE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.func_cache.PREFER_SHARED">
<tt class="descname">PREFER_SHARED</tt><a class="headerlink" href="#pycuda.driver.func_cache.PREFER_SHARED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.func_cache.PREFER_L1">
<tt class="descname">PREFER_L1</tt><a class="headerlink" href="#pycuda.driver.func_cache.PREFER_L1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.func_cache.PREFER_EQUAL">
<tt class="descname">PREFER_EQUAL</tt><a class="headerlink" href="#pycuda.driver.func_cache.PREFER_EQUAL" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.shared_config">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">shared_config</tt><a class="headerlink" href="#pycuda.driver.shared_config" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.Function.set_shared_config" title="pycuda.driver.Function.set_shared_config"><tt class="xref py py-meth docutils literal"><span class="pre">Function.set_shared_config()</span></tt></a>. CUDA 4.2 and above.</p>
<dl class="attribute">
<dt id="pycuda.driver.shared_config.DEFAULT_BANK_SIZE">
<tt class="descname">DEFAULT_BANK_SIZE</tt><a class="headerlink" href="#pycuda.driver.shared_config.DEFAULT_BANK_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.shared_config.FOUR_BYTE_BANK_SIZE">
<tt class="descname">FOUR_BYTE_BANK_SIZE</tt><a class="headerlink" href="#pycuda.driver.shared_config.FOUR_BYTE_BANK_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.shared_config.EIGHT_BYTE_BANK_SIZE">
<tt class="descname">EIGHT_BYTE_BANK_SIZE</tt><a class="headerlink" href="#pycuda.driver.shared_config.EIGHT_BYTE_BANK_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.array_format">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">array_format</tt><a class="headerlink" href="#pycuda.driver.array_format" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.array_format.UNSIGNED_INT8">
<tt class="descname">UNSIGNED_INT8</tt><a class="headerlink" href="#pycuda.driver.array_format.UNSIGNED_INT8" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.UNSIGNED_INT16">
<tt class="descname">UNSIGNED_INT16</tt><a class="headerlink" href="#pycuda.driver.array_format.UNSIGNED_INT16" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.UNSIGNED_INT32">
<tt class="descname">UNSIGNED_INT32</tt><a class="headerlink" href="#pycuda.driver.array_format.UNSIGNED_INT32" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.SIGNED_INT8">
<tt class="descname">SIGNED_INT8</tt><a class="headerlink" href="#pycuda.driver.array_format.SIGNED_INT8" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.SIGNED_INT16">
<tt class="descname">SIGNED_INT16</tt><a class="headerlink" href="#pycuda.driver.array_format.SIGNED_INT16" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.SIGNED_INT32">
<tt class="descname">SIGNED_INT32</tt><a class="headerlink" href="#pycuda.driver.array_format.SIGNED_INT32" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.HALF">
<tt class="descname">HALF</tt><a class="headerlink" href="#pycuda.driver.array_format.HALF" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array_format.FLOAT">
<tt class="descname">FLOAT</tt><a class="headerlink" href="#pycuda.driver.array_format.FLOAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.array3d_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">array3d_flags</tt><a class="headerlink" href="#pycuda.driver.array3d_flags" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.array3d_flags.2DARRAY">
<tt class="descname">2DARRAY</tt><a class="headerlink" href="#pycuda.driver.array3d_flags.2DARRAY" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 and above. Deprecated&#8211;use <a class="reference internal" href="#pycuda.driver.array3d_flags.LAYERED" title="pycuda.driver.array3d_flags.LAYERED"><tt class="xref py py-attr docutils literal"><span class="pre">LAYERED</span></tt></a>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array3d_flags.LAYERED">
<tt class="descname">LAYERED</tt><a class="headerlink" href="#pycuda.driver.array3d_flags.LAYERED" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.array3d_flags.SURFACE_LDST">
<tt class="descname">SURFACE_LDST</tt><a class="headerlink" href="#pycuda.driver.array3d_flags.SURFACE_LDST" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt>
<tt class="descname">CUBEMAP TEXTURE_GATHER</tt></dt>
<dd><p>CUDA 4.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.address_mode">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">address_mode</tt><a class="headerlink" href="#pycuda.driver.address_mode" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.address_mode.WRAP">
<tt class="descname">WRAP</tt><a class="headerlink" href="#pycuda.driver.address_mode.WRAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.address_mode.CLAMP">
<tt class="descname">CLAMP</tt><a class="headerlink" href="#pycuda.driver.address_mode.CLAMP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.address_mode.MIRROR">
<tt class="descname">MIRROR</tt><a class="headerlink" href="#pycuda.driver.address_mode.MIRROR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.address_mode.BORDER">
<tt class="descname">BORDER</tt><a class="headerlink" href="#pycuda.driver.address_mode.BORDER" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.filter_mode">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">filter_mode</tt><a class="headerlink" href="#pycuda.driver.filter_mode" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.filter_mode.POINT">
<tt class="descname">POINT</tt><a class="headerlink" href="#pycuda.driver.filter_mode.POINT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.filter_mode.LINEAR">
<tt class="descname">LINEAR</tt><a class="headerlink" href="#pycuda.driver.filter_mode.LINEAR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.memory_type">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">memory_type</tt><a class="headerlink" href="#pycuda.driver.memory_type" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.memory_type.HOST">
<tt class="descname">HOST</tt><a class="headerlink" href="#pycuda.driver.memory_type.HOST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.memory_type.DEVICE">
<tt class="descname">DEVICE</tt><a class="headerlink" href="#pycuda.driver.memory_type.DEVICE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.memory_type.ARRAY">
<tt class="descname">ARRAY</tt><a class="headerlink" href="#pycuda.driver.memory_type.ARRAY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.compute_mode">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">compute_mode</tt><a class="headerlink" href="#pycuda.driver.compute_mode" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.2 and newer.</p>
<dl class="attribute">
<dt id="pycuda.driver.compute_mode.DEFAULT">
<tt class="descname">DEFAULT</tt><a class="headerlink" href="#pycuda.driver.compute_mode.DEFAULT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.compute_mode.EXCLUSIVE">
<tt class="descname">EXCLUSIVE</tt><a class="headerlink" href="#pycuda.driver.compute_mode.EXCLUSIVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.compute_mode.PROHIBITED">
<tt class="descname">PROHIBITED</tt><a class="headerlink" href="#pycuda.driver.compute_mode.PROHIBITED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.compute_mode.EXCLUSIVE_PROCESS">
<tt class="descname">EXCLUSIVE_PROCESS</tt><a class="headerlink" href="#pycuda.driver.compute_mode.EXCLUSIVE_PROCESS" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.jit_option">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">jit_option</tt><a class="headerlink" href="#pycuda.driver.jit_option" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.1 and newer.</p>
<dl class="attribute">
<dt id="pycuda.driver.jit_option.MAX_REGISTERS">
<tt class="descname">MAX_REGISTERS</tt><a class="headerlink" href="#pycuda.driver.jit_option.MAX_REGISTERS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.THREADS_PER_BLOCK">
<tt class="descname">THREADS_PER_BLOCK</tt><a class="headerlink" href="#pycuda.driver.jit_option.THREADS_PER_BLOCK" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.WALL_TIME">
<tt class="descname">WALL_TIME</tt><a class="headerlink" href="#pycuda.driver.jit_option.WALL_TIME" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.INFO_LOG_BUFFER">
<tt class="descname">INFO_LOG_BUFFER</tt><a class="headerlink" href="#pycuda.driver.jit_option.INFO_LOG_BUFFER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.INFO_LOG_BUFFER_SIZE_BYTES">
<tt class="descname">INFO_LOG_BUFFER_SIZE_BYTES</tt><a class="headerlink" href="#pycuda.driver.jit_option.INFO_LOG_BUFFER_SIZE_BYTES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.ERROR_LOG_BUFFER">
<tt class="descname">ERROR_LOG_BUFFER</tt><a class="headerlink" href="#pycuda.driver.jit_option.ERROR_LOG_BUFFER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.ERROR_LOG_BUFFER_SIZE_BYTES">
<tt class="descname">ERROR_LOG_BUFFER_SIZE_BYTES</tt><a class="headerlink" href="#pycuda.driver.jit_option.ERROR_LOG_BUFFER_SIZE_BYTES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.OPTIMIZATION_LEVEL">
<tt class="descname">OPTIMIZATION_LEVEL</tt><a class="headerlink" href="#pycuda.driver.jit_option.OPTIMIZATION_LEVEL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.TARGET_FROM_CUCONTEXT">
<tt class="descname">TARGET_FROM_CUCONTEXT</tt><a class="headerlink" href="#pycuda.driver.jit_option.TARGET_FROM_CUCONTEXT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.TARGET">
<tt class="descname">TARGET</tt><a class="headerlink" href="#pycuda.driver.jit_option.TARGET" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_option.FALLBACK_STRATEGY">
<tt class="descname">FALLBACK_STRATEGY</tt><a class="headerlink" href="#pycuda.driver.jit_option.FALLBACK_STRATEGY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.jit_target">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">jit_target</tt><a class="headerlink" href="#pycuda.driver.jit_target" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.1 and newer.</p>
<dl class="attribute">
<dt id="pycuda.driver.jit_target.COMPUTE_10">
<tt class="descname">COMPUTE_10</tt><a class="headerlink" href="#pycuda.driver.jit_target.COMPUTE_10" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_target.COMPUTE_11">
<tt class="descname">COMPUTE_11</tt><a class="headerlink" href="#pycuda.driver.jit_target.COMPUTE_11" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_target.COMPUTE_12">
<tt class="descname">COMPUTE_12</tt><a class="headerlink" href="#pycuda.driver.jit_target.COMPUTE_12" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_target.COMPUTE_13">
<tt class="descname">COMPUTE_13</tt><a class="headerlink" href="#pycuda.driver.jit_target.COMPUTE_13" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_target.COMPUTE_20">
<tt class="descname">COMPUTE_20</tt><a class="headerlink" href="#pycuda.driver.jit_target.COMPUTE_20" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_target.COMPUTE_21">
<tt class="descname">COMPUTE_21</tt><a class="headerlink" href="#pycuda.driver.jit_target.COMPUTE_21" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.jit_fallback">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">jit_fallback</tt><a class="headerlink" href="#pycuda.driver.jit_fallback" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 2.1 and newer.</p>
<dl class="attribute">
<dt id="pycuda.driver.jit_fallback.PREFER_PTX">
<tt class="descname">PREFER_PTX</tt><a class="headerlink" href="#pycuda.driver.jit_fallback.PREFER_PTX" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.jit_fallback.PREFER_BINARY">
<tt class="descname">PREFER_BINARY</tt><a class="headerlink" href="#pycuda.driver.jit_fallback.PREFER_BINARY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.host_alloc_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">host_alloc_flags</tt><a class="headerlink" href="#pycuda.driver.host_alloc_flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Flags to be used to allocate <a class="reference internal" href="#pagelocked-memory"><em>Pagelocked Host Memory</em></a>.</p>
<dl class="attribute">
<dt id="pycuda.driver.host_alloc_flags.PORTABLE">
<tt class="descname">PORTABLE</tt><a class="headerlink" href="#pycuda.driver.host_alloc_flags.PORTABLE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.host_alloc_flags.DEVICEMAP">
<tt class="descname">DEVICEMAP</tt><a class="headerlink" href="#pycuda.driver.host_alloc_flags.DEVICEMAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.host_alloc_flags.WRITECOMBINED">
<tt class="descname">WRITECOMBINED</tt><a class="headerlink" href="#pycuda.driver.host_alloc_flags.WRITECOMBINED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.mem_attach_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">mem_attach_flags</tt><a class="headerlink" href="#pycuda.driver.mem_attach_flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Flags to be used to allocate <a class="reference internal" href="#managed-memory"><em>Managed Memory</em></a>.</p>
<p>..versionadded:: 2014.1</p>
<dl class="attribute">
<dt id="pycuda.driver.mem_attach_flags.GLOBAL">
<tt class="descname">GLOBAL</tt><a class="headerlink" href="#pycuda.driver.mem_attach_flags.GLOBAL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.mem_attach_flags.HOST">
<tt class="descname">HOST</tt><a class="headerlink" href="#pycuda.driver.mem_attach_flags.HOST" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.mem_attach_flags.SINGLE">
<tt class="descname">SINGLE</tt><a class="headerlink" href="#pycuda.driver.mem_attach_flags.SINGLE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.mem_host_register_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">mem_host_register_flags</tt><a class="headerlink" href="#pycuda.driver.mem_host_register_flags" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.mem_host_register_flags.PORTABLE">
<tt class="descname">PORTABLE</tt><a class="headerlink" href="#pycuda.driver.mem_host_register_flags.PORTABLE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.mem_host_register_flags.DEVICEMAP">
<tt class="descname">DEVICEMAP</tt><a class="headerlink" href="#pycuda.driver.mem_host_register_flags.DEVICEMAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>CUDA 4.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.limit">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">limit</tt><a class="headerlink" href="#pycuda.driver.limit" title="Permalink to this definition">¶</a></dt>
<dd><p>Limit values for <a class="reference internal" href="#pycuda.driver.Context.get_limit" title="pycuda.driver.Context.get_limit"><tt class="xref py py-meth docutils literal"><span class="pre">Context.get_limit()</span></tt></a> and <a class="reference internal" href="#pycuda.driver.Context.set_limit" title="pycuda.driver.Context.set_limit"><tt class="xref py py-meth docutils literal"><span class="pre">Context.set_limit()</span></tt></a>.</p>
<p>CUDA 3.1 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
<dl class="attribute">
<dt id="pycuda.driver.limit.STACK_SIZE">
<tt class="descname">STACK_SIZE</tt><a class="headerlink" href="#pycuda.driver.limit.STACK_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.limit.PRINTF_FIFO_SIZE">
<tt class="descname">PRINTF_FIFO_SIZE</tt><a class="headerlink" href="#pycuda.driver.limit.PRINTF_FIFO_SIZE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.limit.MALLOC_HEAP_SIE">
<tt class="descname">MALLOC_HEAP_SIE</tt><a class="headerlink" href="#pycuda.driver.limit.MALLOC_HEAP_SIE" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.2 and above.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.ipc_mem_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">ipc_mem_flags</tt><a class="headerlink" href="#pycuda.driver.ipc_mem_flags" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.ipc_mem_flags.LAZY_ENABLE_PEER_ACCESS">
<tt class="descname">LAZY_ENABLE_PEER_ACCESS</tt><a class="headerlink" href="#pycuda.driver.ipc_mem_flags.LAZY_ENABLE_PEER_ACCESS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<div class="section" id="graphics-related-constants">
<h3>Graphics-related constants<a class="headerlink" href="#graphics-related-constants" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pycuda.driver.graphics_register_flags">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">graphics_register_flags</tt><a class="headerlink" href="#pycuda.driver.graphics_register_flags" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
<p>CUDA 4.0 and above.</p>
<dl class="attribute">
<dt>
<tt class="descname">NONE READ_ONLY WRITE_DISCARD SURFACE_LDST</tt></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.graphics_register_flags.TEXTURE_GATHER">
<tt class="descname">TEXTURE_GATHER</tt><a class="headerlink" href="#pycuda.driver.graphics_register_flags.TEXTURE_GATHER" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.array_cubemap_face">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">array_cubemap_face</tt><a class="headerlink" href="#pycuda.driver.array_cubemap_face" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt>
<tt class="descname">POSITIVE_X NEGATIVE_X</tt></dt>
<dt>
<tt class="descname">POSITIVE_Y NEGATIVE_Y</tt></dt>
<dt>
<tt class="descname">POSITIVE_Z NEGATIVE_Z</tt></dt>
<dd></dd></dl>

<p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

</div>
</div>
<div class="section" id="devices-and-contexts">
<h2>Devices and Contexts<a class="headerlink" href="#devices-and-contexts" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="pycuda.driver.get_version">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">get_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.get_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Obtain the version of CUDA against which PyCuda was compiled. Returns a
3-tuple of integers as <em>(major, minor, revision)</em>.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.get_driver_version">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">get_driver_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.get_driver_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Obtain the version of the CUDA driver on top of which PyCUDA is
running. Returns an integer version number.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.init">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">init</tt><big>(</big><em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize CUDA.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This must be called before any other function in this module.</p>
</div>
<p>See also <a class="reference internal" href="util.html#module-pycuda.autoinit" title="pycuda.autoinit"><tt class="xref py py-mod docutils literal"><span class="pre">pycuda.autoinit</span></tt></a>.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Device">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Device</tt><big>(</big><em>number</em><big>)</big><a class="headerlink" href="#pycuda.driver.Device" title="Permalink to this definition">¶</a></dt>
<dt>
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Device</tt><big>(</big><em>pci_bus_id</em><big>)</big></dt>
<dd><p>A handle to the <em>number</em>&#8216;th CUDA device. See also <a class="reference internal" href="util.html#module-pycuda.autoinit" title="pycuda.autoinit"><tt class="xref py py-mod docutils literal"><span class="pre">pycuda.autoinit</span></tt></a>.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 2011.2: </span>The <em>pci_bus_id</em> version of the constructor is new in CUDA 4.1.</p>
</div>
<dl class="staticmethod">
<dt id="pycuda.driver.Device.count">
<em class="property">static </em><tt class="descname">count</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.count" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the number of CUDA devices found.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.name">
<tt class="descname">name</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.pci_bus_id">
<tt class="descname">pci_bus_id</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.pci_bus_id" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.1 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.compute_capability">
<tt class="descname">compute_capability</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.compute_capability" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a 2-tuple indicating the compute capability version of this device.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.total_memory">
<tt class="descname">total_memory</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.total_memory" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the total amount of memory on the device in bytes.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.get_attribute">
<tt class="descname">get_attribute</tt><big>(</big><em>attr</em><big>)</big><a class="headerlink" href="#pycuda.driver.Device.get_attribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the (numeric) value of the attribute <em>attr</em>, which may be one of the
<a class="reference internal" href="#pycuda.driver.device_attribute" title="pycuda.driver.device_attribute"><tt class="xref py py-class docutils literal"><span class="pre">device_attribute</span></tt></a> values.</p>
<p>All <a class="reference internal" href="#pycuda.driver.device_attribute" title="pycuda.driver.device_attribute"><tt class="xref py py-class docutils literal"><span class="pre">device_attribute</span></tt></a> values may also be directly read
as (lower-case) attributes on the <a class="reference internal" href="#pycuda.driver.Device" title="pycuda.driver.Device"><tt class="xref py py-class docutils literal"><span class="pre">Device</span></tt></a> object itself,
e.g. <cite>dev.clock_rate</cite>.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.get_attributes">
<tt class="descname">get_attributes</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.get_attributes" title="Permalink to this definition">¶</a></dt>
<dd><p>Return all device attributes in a <a class="reference external" href="http://docs.python.org/dev/library/stdtypes.html#dict" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a>, with keys from
<a class="reference internal" href="#pycuda.driver.device_attribute" title="pycuda.driver.device_attribute"><tt class="xref py py-class docutils literal"><span class="pre">device_attribute</span></tt></a>.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.make_context">
<tt class="descname">make_context</tt><big>(</big><em>flags=ctx_flags.SCHED_AUTO</em><big>)</big><a class="headerlink" href="#pycuda.driver.Device.make_context" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <a class="reference internal" href="#pycuda.driver.Context" title="pycuda.driver.Context"><tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt></a> on this device, with flags taken from the
<a class="reference internal" href="#pycuda.driver.ctx_flags" title="pycuda.driver.ctx_flags"><tt class="xref py py-class docutils literal"><span class="pre">ctx_flags</span></tt></a> values.</p>
<p>Also make the newly-created context the current context.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.can_access_peer">
<tt class="descname">can_access_peer</tt><big>(</big><em>dev</em><big>)</big><a class="headerlink" href="#pycuda.driver.Device.can_access_peer" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.__hash__">
<tt class="descname">__hash__</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.__hash__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.__eq__">
<tt class="descname">__eq__</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.__eq__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="pycuda.driver.Device.__ne__">
<tt class="descname">__ne__</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Device.__ne__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Context">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Context</tt><a class="headerlink" href="#pycuda.driver.Context" title="Permalink to this definition">¶</a></dt>
<dd><p>An equivalent of a UNIX process on the compute device.
Create instances of this class using <a class="reference internal" href="#pycuda.driver.Device.make_context" title="pycuda.driver.Device.make_context"><tt class="xref py py-meth docutils literal"><span class="pre">Device.make_context()</span></tt></a>.
See also <a class="reference internal" href="util.html#module-pycuda.autoinit" title="pycuda.autoinit"><tt class="xref py py-mod docutils literal"><span class="pre">pycuda.autoinit</span></tt></a>.</p>
<dl class="method">
<dt id="pycuda.driver.Context.detach">
<tt class="descname">detach</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.detach" title="Permalink to this definition">¶</a></dt>
<dd><p>Decrease the reference count on this context. If the reference count
hits zero, the context is deleted.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Context.push">
<tt class="descname">push</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.push" title="Permalink to this definition">¶</a></dt>
<dd><p>Make <em>self</em> the active context, pushing it on top of the context stack.
CUDA 2.0 and above only.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.pop">
<em class="property">static </em><tt class="descname">pop</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove any context from the top of the context stack, deactivating it.
CUDA 2.0 and above only.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.get_device">
<em class="property">static </em><tt class="descname">get_device</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.get_device" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the device that the current context is working on.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.synchronize">
<em class="property">static </em><tt class="descname">synchronize</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.synchronize" title="Permalink to this definition">¶</a></dt>
<dd><p>Wait for all activity in the current context to cease, then return.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.set_limit">
<em class="property">static </em><tt class="descname">set_limit</tt><big>(</big><em>limit</em>, <em>value</em><big>)</big><a class="headerlink" href="#pycuda.driver.Context.set_limit" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.limit" title="pycuda.driver.limit"><tt class="xref py py-class docutils literal"><span class="pre">limit</span></tt></a> for possible values of <em>limit</em>.</p>
<p>CUDA 3.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.get_limit">
<em class="property">static </em><tt class="descname">get_limit</tt><big>(</big><em>limit</em><big>)</big><a class="headerlink" href="#pycuda.driver.Context.get_limit" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.limit" title="pycuda.driver.limit"><tt class="xref py py-class docutils literal"><span class="pre">limit</span></tt></a> for possible values of <em>limit</em>.</p>
<p>CUDA 3.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.set_cache_config">
<em class="property">static </em><tt class="descname">set_cache_config</tt><big>(</big><em>cc</em><big>)</big><a class="headerlink" href="#pycuda.driver.Context.set_cache_config" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.func_cache" title="pycuda.driver.func_cache"><tt class="xref py py-class docutils literal"><span class="pre">func_cache</span></tt></a> for possible values of <em>cc</em>.</p>
<p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.get_cache_config">
<em class="property">static </em><tt class="descname">get_cache_config</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.get_cache_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a value from <a class="reference internal" href="#pycuda.driver.func_cache" title="pycuda.driver.func_cache"><tt class="xref py py-class docutils literal"><span class="pre">func_cache</span></tt></a>.</p>
<p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.set_shared_config">
<em class="property">static </em><tt class="descname">set_shared_config</tt><big>(</big><em>sc</em><big>)</big><a class="headerlink" href="#pycuda.driver.Context.set_shared_config" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.shared_config" title="pycuda.driver.shared_config"><tt class="xref py py-class docutils literal"><span class="pre">shared_config</span></tt></a> for possible values of <em>sc</em>.</p>
<p>CUDA 4.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2013.1.</span></p>
</div>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Context.get_shared_config">
<em class="property">static </em><tt class="descname">get_shared_config</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.get_shared_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a value from <a class="reference internal" href="#pycuda.driver.shared_config" title="pycuda.driver.shared_config"><tt class="xref py py-class docutils literal"><span class="pre">shared_config</span></tt></a>.</p>
<p>CUDA 4.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2013.1.</span></p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Context.get_api_version">
<tt class="descname">get_api_version</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Context.get_api_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an integer API version number.</p>
<p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Context.enable_peer_access">
<tt class="descname">enable_peer_access</tt><big>(</big><em>peer</em>, <em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Context.enable_peer_access" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Context.disable_peer_access">
<tt class="descname">disable_peer_access</tt><big>(</big><em>peer</em>, <em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Context.disable_peer_access" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="concurrency-and-streams">
<h2>Concurrency and Streams<a class="headerlink" href="#concurrency-and-streams" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pycuda.driver.Stream">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Stream</tt><big>(</big><em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Stream" title="Permalink to this definition">¶</a></dt>
<dd><p>A handle for a queue of operations that will be carried out in order.</p>
<dl class="method">
<dt id="pycuda.driver.Stream.synchronize">
<tt class="descname">synchronize</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Stream.synchronize" title="Permalink to this definition">¶</a></dt>
<dd><p>Wait for all activity on this stream to cease, then return.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Stream.is_done">
<tt class="descname">is_done</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Stream.is_done" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <em>True</em> iff all queued operations have completed.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Stream.wait_for_event">
<tt class="descname">wait_for_event</tt><big>(</big><em>evt</em><big>)</big><a class="headerlink" href="#pycuda.driver.Stream.wait_for_event" title="Permalink to this definition">¶</a></dt>
<dd><p>Enqueues a wait for the given <a class="reference internal" href="#pycuda.driver.Event" title="pycuda.driver.Event"><tt class="xref py py-class docutils literal"><span class="pre">Event</span></tt></a> instance.</p>
<p>CUDA 3.2 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Event">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Event</tt><big>(</big><em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Event" title="Permalink to this definition">¶</a></dt>
<dd><p>An event is a temporal &#8216;marker&#8217; in a <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a> that allows taking the time
between two events&#8211;such as the time required to execute a kernel.
An event&#8217;s time is recorded when the <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a> has finished all tasks
enqueued before the <a class="reference internal" href="#pycuda.driver.Event.record" title="pycuda.driver.Event.record"><tt class="xref py py-meth docutils literal"><span class="pre">record()</span></tt></a> call.</p>
<p>See <a class="reference internal" href="#pycuda.driver.event_flags" title="pycuda.driver.event_flags"><tt class="xref py py-class docutils literal"><span class="pre">event_flags</span></tt></a> for values for the <em>flags</em> parameter.</p>
<dl class="method">
<dt id="pycuda.driver.Event.record">
<tt class="descname">record</tt><big>(</big><em>stream=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.Event.record" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert a recording point for <em>self</em> into the <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a> <em>stream</em>.
Return <em>self</em>.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Event.synchronize">
<tt class="descname">synchronize</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Event.synchronize" title="Permalink to this definition">¶</a></dt>
<dd><p>Wait until the device execution stream reaches this event.
Return <em>self</em>.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Event.query">
<tt class="descname">query</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Event.query" title="Permalink to this definition">¶</a></dt>
<dd><p>Return <em>True</em> if the device execution stream has reached this event.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Event.time_since">
<tt class="descname">time_since</tt><big>(</big><em>event</em><big>)</big><a class="headerlink" href="#pycuda.driver.Event.time_since" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the time in milliseconds that has passed between <em>self</em> and <em>event</em>.
Use this method as <cite>end.time_since(start)</cite>. Note that this method will fail
with an &#8220;invalid value&#8221; error if either of the events has not been reached yet.
Use <a class="reference internal" href="#pycuda.driver.Event.synchronize" title="pycuda.driver.Event.synchronize"><tt class="xref py py-meth docutils literal"><span class="pre">synchronize()</span></tt></a> to ensure that the event has been reached.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Event.time_till">
<tt class="descname">time_till</tt><big>(</big><em>event</em><big>)</big><a class="headerlink" href="#pycuda.driver.Event.time_till" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the time in milliseconds that has passed between <em>event</em> and <em>self</em>.
Use this method as <cite>start.time_till(end)</cite>. Note that this method will fail
with an &#8220;invalid value&#8221; error if either of the events has not been reached yet.
Use <a class="reference internal" href="#pycuda.driver.Event.synchronize" title="pycuda.driver.Event.synchronize"><tt class="xref py py-meth docutils literal"><span class="pre">synchronize()</span></tt></a> to ensure that the event has been reached.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Event.ipc_handle">
<tt class="descname">ipc_handle</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Event.ipc_handle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference external" href="http://docs.python.org/dev/library/functions.html#bytes" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">bytes</span></tt></a> object representing an IPC handle to this event.
Requires Python 2.6 and CUDA 4.1.</p>
</dd></dl>

<dl class="staticmethod">
<dt id="pycuda.driver.Event.from_ipc_handle">
<em class="property">static </em><tt class="descname">from_ipc_handle</tt><big>(</big><em>handle</em><big>)</big><a class="headerlink" href="#pycuda.driver.Event.from_ipc_handle" title="Permalink to this definition">¶</a></dt>
<dd><p>Requires Python 2.6 and CUDA 4.1.</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>
<div class="section" id="global-device-memory">
<h3>Global Device Memory<a class="headerlink" href="#global-device-memory" title="Permalink to this headline">¶</a></h3>
<dl class="function">
<dt id="pycuda.driver.mem_get_info">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">mem_get_info</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.mem_get_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple <em>(free, total)</em> indicating the free and total memory
in the current context, in bytes.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.mem_alloc">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">mem_alloc</tt><big>(</big><em>bytes</em><big>)</big><a class="headerlink" href="#pycuda.driver.mem_alloc" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a> object representing a linear
piece of device memory.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.to_device">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">to_device</tt><big>(</big><em>buffer</em><big>)</big><a class="headerlink" href="#pycuda.driver.to_device" title="Permalink to this definition">¶</a></dt>
<dd><p>Allocate enough device memory for <em>buffer</em>, which adheres to the Python
<tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt> interface. Copy the contents of <em>buffer</em> onto the device.
Return a <a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a> object representing the newly-allocated
memory.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.from_device">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">from_device</tt><big>(</big><em>devptr</em>, <em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em><big>)</big><a class="headerlink" href="#pycuda.driver.from_device" title="Permalink to this definition">¶</a></dt>
<dd><p>Make a new <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> from the data at <em>devptr</em> on the
GPU, interpreting them using <em>shape</em>, <em>dtype</em> and <em>order</em>.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.from_device_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">from_device_like</tt><big>(</big><em>devptr</em>, <em>other_ary</em><big>)</big><a class="headerlink" href="#pycuda.driver.from_device_like" title="Permalink to this definition">¶</a></dt>
<dd><p>Make a new <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> from the data at <em>devptr</em> on the
GPU, interpreting them as having the same shape, dtype and order
as <em>other_ary</em>.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.mem_alloc_pitch">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">mem_alloc_pitch</tt><big>(</big><em>width</em>, <em>height</em>, <em>access_size</em><big>)</big><a class="headerlink" href="#pycuda.driver.mem_alloc_pitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Allocates a linear piece of device memory at least <em>width</em> bytes wide and
<em>height</em> rows high that an be accessed using a data type of size
<em>access_size</em> in a coalesced fashion.</p>
<p>Returns a tuple <em>(dev_alloc, actual_pitch)</em> giving a <a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>
and the actual width of each row in bytes.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.DeviceAllocation">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">DeviceAllocation</tt><a class="headerlink" href="#pycuda.driver.DeviceAllocation" title="Permalink to this definition">¶</a></dt>
<dd><p>An object representing an allocation of linear device memory.
Once this object is deleted, its associated device memory is
freed.</p>
<p>Objects of this type can be cast to <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> to obtain a linear index
into this <a class="reference internal" href="#pycuda.driver.Context" title="pycuda.driver.Context"><tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt></a>&#8216;s memory.</p>
<dl class="method">
<dt id="pycuda.driver.DeviceAllocation.free">
<tt class="descname">free</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.DeviceAllocation.free" title="Permalink to this definition">¶</a></dt>
<dd><p>Release the held device memory now instead of when this object
becomes unreachable. Any further use of the object is an error
and will lead to undefined behavior.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.DeviceAllocation.as_buffer">
<tt class="descname">as_buffer</tt><big>(</big><em>size</em>, <em>offset=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.DeviceAllocation.as_buffer" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the pointer encapsulated by <em>self</em> as a Python buffer
object, with the given <em>size</em> and, optionally, <em>offset</em>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="pycuda.driver.mem_get_ipc_handle">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">mem_get_ipc_handle</tt><big>(</big><em>devptr</em><big>)</big><a class="headerlink" href="#pycuda.driver.mem_get_ipc_handle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an opaque <a class="reference external" href="http://docs.python.org/dev/library/functions.html#bytes" title="(in Python v3.5)"><tt class="xref py py-class docutils literal"><span class="pre">bytes</span></tt></a> object representing an IPC handle to the
device pointer <em>devptr</em>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
<p>Requires CUDA 4.1 and Python 2.6.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.IPCMemoryHandle">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">IPCMemoryHandle</tt><big>(</big><em>ipc_handle</em>, <em>flags=ipc_mem_flags.LAZY_ENABLE_PEER_ACCESS</em><big>)</big><a class="headerlink" href="#pycuda.driver.IPCMemoryHandle" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.2.</span></p>
</div>
<p>Requires CUDA 4.1 and Python 2.6.</p>
<p>Objects of this type can be used in the same ways as a
<a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>.</p>
<dl class="method">
<dt id="pycuda.driver.IPCMemoryHandle.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.IPCMemoryHandle.close" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.PointerHolderBase">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">PointerHolderBase</tt><a class="headerlink" href="#pycuda.driver.PointerHolderBase" title="Permalink to this definition">¶</a></dt>
<dd><p>A base class that facilitates casting to pointers within PyCUDA.
This allows the user to construct custom pointer types that may
have been allocated by facilities outside of PyCUDA proper, but
still need to be objects to facilitate RAII. The user needs to
supply one method to facilitate the pointer cast:</p>
<dl class="method">
<dt id="pycuda.driver.PointerHolderBase.get_pointer">
<tt class="descname">get_pointer</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.PointerHolderBase.get_pointer" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the pointer encapsulated by <em>self</em>.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.PointerHolderBase.as_buffer">
<tt class="descname">as_buffer</tt><big>(</big><em>size</em>, <em>offset=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.PointerHolderBase.as_buffer" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the pointer encapsulated by <em>self</em> as a Python buffer
object, with the given <em>size</em> and, optionally, <em>offset</em>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="pagelocked-host-memory">
<span id="pagelocked-memory"></span><h3>Pagelocked Host Memory<a class="headerlink" href="#pagelocked-host-memory" title="Permalink to this headline">¶</a></h3>
<div class="section" id="pagelocked-allocation">
<h4>Pagelocked Allocation<a class="headerlink" href="#pagelocked-allocation" title="Permalink to this headline">¶</a></h4>
<dl class="function">
<dt id="pycuda.driver.pagelocked_empty">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">pagelocked_empty</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.pagelocked_empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Allocate a pagelocked <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> of <em>shape</em>, <em>dtype</em> and <em>order</em>.</p>
<p><em>mem_flags</em> may be one of the values in <a class="reference internal" href="#pycuda.driver.host_alloc_flags" title="pycuda.driver.host_alloc_flags"><tt class="xref py py-class docutils literal"><span class="pre">host_alloc_flags</span></tt></a>.
It may only be non-zero on CUDA 2.2 and newer.</p>
<p>For the meaning of the other parameters, please refer to the <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a>
documentation.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.pagelocked_zeros">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">pagelocked_zeros</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.pagelocked_zeros" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#pycuda.driver.pagelocked_empty" title="pycuda.driver.pagelocked_empty"><tt class="xref py py-func docutils literal"><span class="pre">pagelocked_empty()</span></tt></a>, but initialized to zero.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.pagelocked_empty_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">pagelocked_empty_like</tt><big>(</big><em>array</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.pagelocked_empty_like" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.pagelocked_zeros_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">pagelocked_zeros_like</tt><big>(</big><em>array</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.pagelocked_zeros_like" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>The <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> instances returned by these functions
have an attribute <em>base</em> that references an object of type</p>
<dl class="class">
<dt id="pycuda.driver.PagelockedHostAllocation">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">PagelockedHostAllocation</tt><a class="headerlink" href="#pycuda.driver.PagelockedHostAllocation" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#pycuda.driver.HostPointer" title="pycuda.driver.HostPointer"><tt class="xref py py-class docutils literal"><span class="pre">HostPointer</span></tt></a>.</p>
<p>An object representing an allocation of pagelocked
host memory.  Once this object is deleted, its associated
device memory is freed.</p>
<dl class="method">
<dt id="pycuda.driver.PagelockedHostAllocation.free">
<tt class="descname">free</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.PagelockedHostAllocation.free" title="Permalink to this definition">¶</a></dt>
<dd><p>Release the held memory now instead of when this object
becomes unreachable. Any further use of the object (or its
associated <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> array) is an error
and will lead to undefined behavior.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.PagelockedHostAllocation.get_flags">
<tt class="descname">get_flags</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.PagelockedHostAllocation.get_flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a bit field of values from <a class="reference internal" href="#pycuda.driver.host_alloc_flags" title="pycuda.driver.host_alloc_flags"><tt class="xref py py-class docutils literal"><span class="pre">host_alloc_flags</span></tt></a>.</p>
<p>Only available on CUDA 3.2 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.HostAllocation">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">HostAllocation</tt><a class="headerlink" href="#pycuda.driver.HostAllocation" title="Permalink to this definition">¶</a></dt>
<dd><p>A deprecated name for <a class="reference internal" href="#pycuda.driver.PagelockedHostAllocation" title="pycuda.driver.PagelockedHostAllocation"><tt class="xref py py-class docutils literal"><span class="pre">PagelockedHostAllocation</span></tt></a>.</p>
</dd></dl>

</div>
<div class="section" id="aligned-host-memory">
<span id="id1"></span><h4>Aligned Host Memory<a class="headerlink" href="#aligned-host-memory" title="Permalink to this headline">¶</a></h4>
<dl class="function">
<dt id="pycuda.driver.aligned_empty">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">aligned_empty</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>alignment=4096</em><big>)</big><a class="headerlink" href="#pycuda.driver.aligned_empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Allocate an <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> of <em>shape</em>, <em>dtype</em> and <em>order</em>,
with data aligned to <em>alignment</em> bytes.</p>
<p>For the meaning of the other parameters, please refer to the <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a>
documentation.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.aligned_zeros">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">aligned_zeros</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>alignment=4096</em><big>)</big><a class="headerlink" href="#pycuda.driver.aligned_zeros" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#pycuda.driver.aligned_empty" title="pycuda.driver.aligned_empty"><tt class="xref py py-func docutils literal"><span class="pre">aligned_empty()</span></tt></a>, but with initialization to zero.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.aligned_empty_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">aligned_empty_like</tt><big>(</big><em>array</em>, <em>alignment=4096</em><big>)</big><a class="headerlink" href="#pycuda.driver.aligned_empty_like" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.aligned_zeros_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">aligned_zeros_like</tt><big>(</big><em>array</em>, <em>alignment=4096</em><big>)</big><a class="headerlink" href="#pycuda.driver.aligned_zeros_like" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<p>The <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> instances returned by these functions
have an attribute <em>base</em> that references an object of type</p>
<dl class="class">
<dt id="pycuda.driver.AlignedHostAllocation">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">AlignedHostAllocation</tt><a class="headerlink" href="#pycuda.driver.AlignedHostAllocation" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#pycuda.driver.HostPointer" title="pycuda.driver.HostPointer"><tt class="xref py py-class docutils literal"><span class="pre">HostPointer</span></tt></a>.</p>
<p>An object representing an allocation of aligned
host memory.</p>
<dl class="method">
<dt id="pycuda.driver.AlignedHostAllocation.free">
<tt class="descname">free</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.AlignedHostAllocation.free" title="Permalink to this definition">¶</a></dt>
<dd><p>Release the held memory now instead of when this object
becomes unreachable. Any further use of the object (or its
associated <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> array) is an error
and will lead to undefined behavior.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="post-allocation-pagelocking">
<h4>Post-Allocation Pagelocking<a class="headerlink" href="#post-allocation-pagelocking" title="Permalink to this headline">¶</a></h4>
<dl class="function">
<dt id="pycuda.driver.register_host_memory">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">register_host_memory</tt><big>(</big><em>ary</em>, <em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.register_host_memory" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> which shares memory with <em>ary</em>.
This memory will be page-locked as long as the return value of
this function is alive.</p>
<p>The returned array&#8217;s <em>base</em> attribute contains a
<a class="reference internal" href="#pycuda.driver.RegisteredHostMemory" title="pycuda.driver.RegisteredHostMemory"><tt class="xref py py-class docutils literal"><span class="pre">RegisteredHostMemory</span></tt></a> instance, whose <em>base</em> attribute
in turn contains <em>ary</em>.</p>
<p>CUDA 4.0 and newer.</p>
<p><em>ary</em>&#8216;s data address and size must be page-aligned. One way to achieve this
is to use the functions in <a class="reference internal" href="#aligned-host-memory"><em>Aligned Host Memory</em></a>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.RegisteredHostMemory">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">RegisteredHostMemory</tt><a class="headerlink" href="#pycuda.driver.RegisteredHostMemory" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#pycuda.driver.HostPointer" title="pycuda.driver.HostPointer"><tt class="xref py py-class docutils literal"><span class="pre">HostPointer</span></tt></a>.</p>
<p>CUDA 4.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
<dl class="method">
<dt id="pycuda.driver.RegisteredHostMemory.unregister">
<tt class="descname">unregister</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.RegisteredHostMemory.unregister" title="Permalink to this definition">¶</a></dt>
<dd><p>Unregister the page-lock on the host memory held by this instance.
Note that this does not free the memory, it only frees the
page-lock.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.RegisteredHostMemory.base">
<tt class="descname">base</tt><a class="headerlink" href="#pycuda.driver.RegisteredHostMemory.base" title="Permalink to this definition">¶</a></dt>
<dd><p>Contains the Python object from which this instance was constructed.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.HostPointer">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">HostPointer</tt><a class="headerlink" href="#pycuda.driver.HostPointer" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents a page-locked host pointer.</p>
<dl class="method">
<dt id="pycuda.driver.HostPointer.get_device_pointer">
<tt class="descname">get_device_pointer</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.HostPointer.get_device_pointer" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a device pointer that indicates the address at which
this memory is mapped into the device&#8217;s address space.</p>
<p>Only available on CUDA 2.2 and newer.</p>
</dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="managed-memory">
<span id="id2"></span><h3>Managed Memory<a class="headerlink" href="#managed-memory" title="Permalink to this headline">¶</a></h3>
<p>CUDA 6.0 adds support for a &#8220;Unified Memory&#8221; model, which creates a managed
virtual memory space that is visible to both CPUs and GPUs.  The OS will
migrate the physical pages associated with managed memory between the CPU and
GPU as needed.  This allows a numpy array on the host to be passed to kernels
without first creating a DeviceAllocation and manually copying the host data
to and from the device.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Managed memory is only available for some combinations of CUDA device,
operating system, and host compiler target architecture.  Check the CUDA
C Programming Guide and CUDA release notes for details.</p>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This interface to managed memory should be considered experimental. It is
provided as a preview, but for now the same interface stability guarantees
as for the rest of PyCUDA do not apply.</p>
</div>
<div class="section" id="managed-memory-allocation">
<h4>Managed Memory Allocation<a class="headerlink" href="#managed-memory-allocation" title="Permalink to this headline">¶</a></h4>
<dl class="function">
<dt id="pycuda.driver.managed_empty">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">managed_empty</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.managed_empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Allocate a managed <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> of <em>shape</em>, <em>dtype</em> and <em>order</em>.</p>
<p><em>mem_flags</em> may be one of the values in <a class="reference internal" href="#pycuda.driver.mem_attach_flags" title="pycuda.driver.mem_attach_flags"><tt class="xref py py-class docutils literal"><span class="pre">mem_attach_flags</span></tt></a>.</p>
<p>For the meaning of the other parameters, please refer to the <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a>
documentation.</p>
<p>Only available on CUDA 6.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.managed_zeros">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">managed_zeros</tt><big>(</big><em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.managed_zeros" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#pycuda.driver.managed_empty" title="pycuda.driver.managed_empty"><tt class="xref py py-func docutils literal"><span class="pre">managed_empty()</span></tt></a>, but initialized to zero.</p>
<p>Only available on CUDA 6.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.managed_empty_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">managed_empty_like</tt><big>(</big><em>array</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.managed_empty_like" title="Permalink to this definition">¶</a></dt>
<dd><p>Only available on CUDA 6.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.managed_zeros_like">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">managed_zeros_like</tt><big>(</big><em>array</em>, <em>mem_flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.managed_zeros_like" title="Permalink to this definition">¶</a></dt>
<dd><p>Only available on CUDA 6.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2014.1.</span></p>
</div>
</dd></dl>

<p>The <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> instances returned by these functions
have an attribute <em>base</em> that references an object of type</p>
<dl class="class">
<dt id="pycuda.driver.ManagedAllocation">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">ManagedAllocation</tt><a class="headerlink" href="#pycuda.driver.ManagedAllocation" title="Permalink to this definition">¶</a></dt>
<dd><p>An object representing an allocation of managed
host memory.  Once this object is deleted, its associated
CUDA managed memory is freed.</p>
<dl class="method">
<dt id="pycuda.driver.ManagedAllocation.free">
<tt class="descname">free</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.ManagedAllocation.free" title="Permalink to this definition">¶</a></dt>
<dd><p>Release the held memory now instead of when this object
becomes unreachable. Any further use of the object (or its
associated <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> array) is an error
and will lead to undefined behavior.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.ManagedAllocation.get_device_pointer">
<tt class="descname">get_device_pointer</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.ManagedAllocation.get_device_pointer" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a device pointer that indicates the address at which
this memory is mapped into the device&#8217;s address space.  For
managed memory, this is also the host pointer.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.ManagedAllocation.attach">
<tt class="descname">attach</tt><big>(</big><em>mem_flags</em>, <em>stream=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.ManagedAllocation.attach" title="Permalink to this definition">¶</a></dt>
<dd><p>Alter the visibility of the managed allocation to be one of the values
in <a class="reference internal" href="#pycuda.driver.mem_attach_flags" title="pycuda.driver.mem_attach_flags"><tt class="xref py py-class docutils literal"><span class="pre">mem_attach_flags</span></tt></a>.  A managed array can be made visible to
the host CPU and the entire CUDA context with
<em>mem_attach_flags.GLOBAL</em>, or limited to the CPU only with
<em>mem_attach_flags.HOST</em>.  If <em>mem_attach_flags.SINGLE</em> is selected,
then the array will only be visible to CPU and the provided instance
of <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a>.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="managed-memory-usage">
<h4>Managed Memory Usage<a class="headerlink" href="#managed-memory-usage" title="Permalink to this headline">¶</a></h4>
<p>A managed numpy array is constructed and used on the host in a similar manner
to a pagelocked array:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pycuda.autoinit</span> <span class="kn">import</span> <span class="n">context</span>
<span class="kn">import</span> <span class="nn">pycuda.driver</span> <span class="kn">as</span> <span class="nn">cuda</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>

<span class="n">a</span> <span class="o">=</span> <span class="n">cuda</span><span class="o">.</span><span class="n">managed_empty</span><span class="p">(</span><span class="n">shape</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">,</span> <span class="n">mem_flags</span><span class="o">=</span><span class="n">cuda</span><span class="o">.</span><span class="n">mem_attach_flags</span><span class="o">.</span><span class="n">GLOBAL</span><span class="p">)</span>
<span class="n">a</span><span class="p">[:]</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">9</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">a</span><span class="p">))</span> <span class="c"># Fill array on host</span>
</pre></div>
</div>
<p>It can be passed to a GPU kernel, and used again on the host without
an explicit copy:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">pycuda.compiler</span> <span class="kn">import</span> <span class="n">SourceModule</span>
<span class="n">mod</span> <span class="o">=</span> <span class="n">SourceModule</span><span class="p">(</span><span class="s">&quot;&quot;&quot;</span>
<span class="s">__global__ void doublify(float *a)</span>
<span class="s">{</span>
<span class="s">    a[threadIdx.x] *= 2;</span>
<span class="s">}</span>
<span class="s">&quot;&quot;&quot;</span><span class="p">)</span>
<span class="n">doublify</span> <span class="o">=</span> <span class="n">mod</span><span class="o">.</span><span class="n">get_function</span><span class="p">(</span><span class="s">&quot;doublify&quot;</span><span class="p">)</span>

<span class="n">doublify</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">grid</span><span class="o">=</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">),</span> <span class="n">block</span><span class="o">=</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">a</span><span class="p">),</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">))</span>
<span class="n">context</span><span class="o">.</span><span class="n">synchronize</span><span class="p">()</span> <span class="c"># Wait for kernel completion before host access</span>

<span class="n">median</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">median</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="c"># Computed on host!</span>
</pre></div>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>The CUDA Unified Memory model has very specific rules regarding concurrent
access of managed memory allocations.  Host access to any managed array
is not allowed while the GPU is executing a kernel, regardless of whether
the array is in use by the running kernel.  Failure to follow the
concurrency rules will generate a segmentation fault, <em>causing the Python
interpreter to terminate immediately</em>.</p>
<p>Users of managed numpy arrays should read the &#8220;Unified Memory Programming&#8221;
appendix of the CUDA C Programming Guide for further details on the
concurrency restrictions.</p>
<p class="last">If you are encountering interpreter terminations due to concurrency issues,
the <cite>faulthandler &lt;http://pypi.python.org/pypi/faulthandler&gt;</cite> module may be
helpful in locating the location in your Python program where the faulty
access is occurring.</p>
</div>
</div>
</div>
<div class="section" id="arrays-and-textures">
<h3>Arrays and Textures<a class="headerlink" href="#arrays-and-textures" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pycuda.driver.ArrayDescriptor">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">ArrayDescriptor</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor.width">
<tt class="descname">width</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor.width" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor.height">
<tt class="descname">height</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor.height" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor.format">
<tt class="descname">format</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor.format" title="Permalink to this definition">¶</a></dt>
<dd><p>A value of type <a class="reference internal" href="#pycuda.driver.array_format" title="pycuda.driver.array_format"><tt class="xref py py-class docutils literal"><span class="pre">array_format</span></tt></a>.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor.num_channels">
<tt class="descname">num_channels</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor.num_channels" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.ArrayDescriptor3D">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">ArrayDescriptor3D</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor3D" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor3D.width">
<tt class="descname">width</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor3D.width" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor3D.height">
<tt class="descname">height</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor3D.height" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor3D.depth">
<tt class="descname">depth</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor3D.depth" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor3D.format">
<tt class="descname">format</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor3D.format" title="Permalink to this definition">¶</a></dt>
<dd><p>A value of type <a class="reference internal" href="#pycuda.driver.array_format" title="pycuda.driver.array_format"><tt class="xref py py-class docutils literal"><span class="pre">array_format</span></tt></a>. CUDA 2.0 and above only.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.ArrayDescriptor3D.num_channels">
<tt class="descname">num_channels</tt><a class="headerlink" href="#pycuda.driver.ArrayDescriptor3D.num_channels" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Array">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Array</tt><big>(</big><em>descriptor</em><big>)</big><a class="headerlink" href="#pycuda.driver.Array" title="Permalink to this definition">¶</a></dt>
<dd><p>A 2D or 3D memory block that can only be accessed via
texture references.</p>
<p><em>descriptor</em> can be of type <a class="reference internal" href="#pycuda.driver.ArrayDescriptor" title="pycuda.driver.ArrayDescriptor"><tt class="xref py py-class docutils literal"><span class="pre">ArrayDescriptor</span></tt></a> or
<a class="reference internal" href="#pycuda.driver.ArrayDescriptor3D" title="pycuda.driver.ArrayDescriptor3D"><tt class="xref py py-class docutils literal"><span class="pre">ArrayDescriptor3D</span></tt></a>.</p>
<dl class="method">
<dt id="pycuda.driver.Array.free">
<tt class="descname">free</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Array.free" title="Permalink to this definition">¶</a></dt>
<dd><p>Release the array and its device memory now instead of when
this object becomes unreachable. Any further use of the
object is an error and will lead to undefined behavior.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Array.get_descriptor">
<tt class="descname">get_descriptor</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Array.get_descriptor" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference internal" href="#pycuda.driver.ArrayDescriptor" title="pycuda.driver.ArrayDescriptor"><tt class="xref py py-class docutils literal"><span class="pre">ArrayDescriptor</span></tt></a> object for this 2D array,
like the one that was used to create it.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Array.get_descriptor_3d">
<tt class="descname">get_descriptor_3d</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Array.get_descriptor_3d" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a <a class="reference internal" href="#pycuda.driver.ArrayDescriptor3D" title="pycuda.driver.ArrayDescriptor3D"><tt class="xref py py-class docutils literal"><span class="pre">ArrayDescriptor3D</span></tt></a> object for this 3D array,
like the one that was used to create it.  CUDA 2.0 and above only.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.SurfaceReference">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">SurfaceReference</tt><a class="headerlink" href="#pycuda.driver.SurfaceReference" title="Permalink to this definition">¶</a></dt>
<dd><div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Instances of this class can only be constructed through
<a class="reference internal" href="#pycuda.driver.Module.get_surfref" title="pycuda.driver.Module.get_surfref"><tt class="xref py py-meth docutils literal"><span class="pre">Module.get_surfref()</span></tt></a>.</p>
</div>
<p>CUDA 3.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
<dl class="method">
<dt id="pycuda.driver.SurfaceReference.set_array">
<tt class="descname">set_array</tt><big>(</big><em>array</em>, <em>flags=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.SurfaceReference.set_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Bind <em>self</em> to the <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> <em>array</em>.</p>
<p>As long as <em>array</em> remains bound to this texture reference, it will not be
freed&#8211;the texture reference keeps a reference to the array.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.SurfaceReference.get_array">
<tt class="descname">get_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.SurfaceReference.get_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Get back the <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> to which <em>self</em> is bound.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This will be a different object than the one passed to
<a class="reference internal" href="#pycuda.driver.SurfaceReference.set_array" title="pycuda.driver.SurfaceReference.set_array"><tt class="xref py py-meth docutils literal"><span class="pre">set_array()</span></tt></a>, but it will compare equal.</p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.TextureReference">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">TextureReference</tt><a class="headerlink" href="#pycuda.driver.TextureReference" title="Permalink to this definition">¶</a></dt>
<dd><p>A handle to a binding of either linear memory or an <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> to
a texture unit.</p>
<dl class="method">
<dt id="pycuda.driver.TextureReference.set_array">
<tt class="descname">set_array</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.set_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Bind <em>self</em> to the <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> <em>array</em>.</p>
<p>As long as <em>array</em> remains bound to this texture reference, it will not be
freed&#8211;the texture reference keeps a reference to the array.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.set_address">
<tt class="descname">set_address</tt><big>(</big><em>devptr</em>, <em>bytes</em>, <em>allow_offset=False</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.set_address" title="Permalink to this definition">¶</a></dt>
<dd><p>Bind <em>self</em> to the a chunk of linear memory starting at the integer address
<em>devptr</em>, encompassing a number of <em>bytes</em>. Due to alignment requirements,
the effective texture bind address may be different from the requested one
by an offset. This method returns this offset in bytes. If <em>allow_offset</em>
is <tt class="docutils literal"><span class="pre">False</span></tt>, a nonzero value of this offset will cause an exception to be
raised.</p>
<p>Unlike for <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> objects, no life support is provided for linear memory
bound to texture references.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.set_address_2d">
<tt class="descname">set_address_2d</tt><big>(</big><em>devptr</em>, <em>descr</em>, <em>pitch</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.set_address_2d" title="Permalink to this definition">¶</a></dt>
<dd><p>Bind <em>self</em> as a 2-dimensional texture to a chunk of global memory
at <em>devptr</em>. The line-to-line offset in bytes is given by <em>pitch</em>.
Width, height and format are given in the <a class="reference internal" href="#pycuda.driver.ArrayDescriptor" title="pycuda.driver.ArrayDescriptor"><tt class="xref py py-class docutils literal"><span class="pre">ArrayDescriptor</span></tt></a>
<em>descr</em>. <a class="reference internal" href="#pycuda.driver.TextureReference.set_format" title="pycuda.driver.TextureReference.set_format"><tt class="xref py py-meth docutils literal"><span class="pre">set_format()</span></tt></a> need not and should not be called in
addition to this method.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.set_format">
<tt class="descname">set_format</tt><big>(</big><em>fmt</em>, <em>num_components</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.set_format" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the texture to have <a class="reference internal" href="#pycuda.driver.array_format" title="pycuda.driver.array_format"><tt class="xref py py-class docutils literal"><span class="pre">array_format</span></tt></a> <em>fmt</em> and to have
<em>num_components</em> channels.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.set_address_mode">
<tt class="descname">set_address_mode</tt><big>(</big><em>dim</em>, <em>am</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.set_address_mode" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the address mode of dimension <em>dim</em> to <em>am</em>, which must be one of the
<a class="reference internal" href="#pycuda.driver.address_mode" title="pycuda.driver.address_mode"><tt class="xref py py-class docutils literal"><span class="pre">address_mode</span></tt></a> values.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.set_flags">
<tt class="descname">set_flags</tt><big>(</big><em>flags</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.set_flags" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the flags to a combination of the <em>TRSF_XXX</em> values.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.get_array">
<tt class="descname">get_array</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.get_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Get back the <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> to which <em>self</em> is bound.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This will be a different object than the one passed to
<a class="reference internal" href="#pycuda.driver.TextureReference.set_array" title="pycuda.driver.TextureReference.set_array"><tt class="xref py py-meth docutils literal"><span class="pre">set_array()</span></tt></a>, but it will compare equal.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.get_address_mode">
<tt class="descname">get_address_mode</tt><big>(</big><em>dim</em><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.get_address_mode" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.get_filter_mode">
<tt class="descname">get_filter_mode</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.get_filter_mode" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.get_format">
<tt class="descname">get_format</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.get_format" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple <em>(fmt, num_components)</em>, where <em>fmt</em> is
of type <a class="reference internal" href="#pycuda.driver.array_format" title="pycuda.driver.array_format"><tt class="xref py py-class docutils literal"><span class="pre">array_format</span></tt></a>, and <em>num_components</em> is the
number of channels in this texture.</p>
<p>(Version 2.0 and above only.)</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.TextureReference.get_flags">
<tt class="descname">get_flags</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.TextureReference.get_flags" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="data">
<dt id="pycuda.driver.TRSA_OVERRIDE_FORMAT">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">TRSA_OVERRIDE_FORMAT</tt><a class="headerlink" href="#pycuda.driver.TRSA_OVERRIDE_FORMAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="data">
<dt id="pycuda.driver.TRSF_READ_AS_INTEGER">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">TRSF_READ_AS_INTEGER</tt><a class="headerlink" href="#pycuda.driver.TRSF_READ_AS_INTEGER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="data">
<dt id="pycuda.driver.TRSF_NORMALIZED_COORDINATES">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">TRSF_NORMALIZED_COORDINATES</tt><a class="headerlink" href="#pycuda.driver.TRSF_NORMALIZED_COORDINATES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="data">
<dt id="pycuda.driver.TR_DEFAULT">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">TR_DEFAULT</tt><a class="headerlink" href="#pycuda.driver.TR_DEFAULT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.matrix_to_array">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">matrix_to_array</tt><big>(</big><em>matrix</em>, <em>order</em><big>)</big><a class="headerlink" href="#pycuda.driver.matrix_to_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Turn the two-dimensional <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> object <em>matrix</em> into an
<a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a>.
The <cite>order</cite> argument can be either <cite>&#8220;C&#8221;</cite> or <cite>&#8220;F&#8221;</cite>. If
it is <cite>&#8220;C&#8221;</cite>, then <cite>tex2D(x,y)</cite> is going to fetch <cite>matrix[y,x]</cite>,
and vice versa for for <cite>&#8220;F&#8221;</cite>.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.make_multichannel_2d_array">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">make_multichannel_2d_array</tt><big>(</big><em>matrix</em>, <em>order</em><big>)</big><a class="headerlink" href="#pycuda.driver.make_multichannel_2d_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Turn the three-dimensional <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> object <em>matrix</em> into
an 2D <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> with multiple channels.</p>
<p>Depending on <cite>order</cite>, the <cite>matrix</cite>&#8216;s shape is interpreted as</p>
<ul class="simple">
<li><cite>height, width, num_channels</cite> for <cite>order == &#8220;C&#8221;</cite>,</li>
<li><cite>num_channels, width, height</cite> for <cite>order == &#8220;F&#8221;</cite>.</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This function assumes that <em>matrix</em> has been created with
the memory order <em>order</em>. If that is not the case, the
copied data will likely not be what you expect.</p>
</div>
</dd></dl>

</div>
<div class="section" id="initializing-device-memory">
<span id="memset"></span><h3>Initializing Device Memory<a class="headerlink" href="#initializing-device-memory" title="Permalink to this headline">¶</a></h3>
<dl class="function">
<dt id="pycuda.driver.memset_d8">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memset_d8</tt><big>(</big><em>dest</em>, <em>data</em>, <em>count</em><big>)</big><a class="headerlink" href="#pycuda.driver.memset_d8" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memset_d16">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memset_d16</tt><big>(</big><em>dest</em>, <em>data</em>, <em>count</em><big>)</big><a class="headerlink" href="#pycuda.driver.memset_d16" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memset_d32">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memset_d32</tt><big>(</big><em>dest</em>, <em>data</em>, <em>count</em><big>)</big><a class="headerlink" href="#pycuda.driver.memset_d32" title="Permalink to this definition">¶</a></dt>
<dd><div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><em>count</em> is the number of elements, not bytes.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memset_d2d8">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memset_d2d8</tt><big>(</big><em>dest</em>, <em>pitch</em>, <em>data</em>, <em>width</em>, <em>height</em><big>)</big><a class="headerlink" href="#pycuda.driver.memset_d2d8" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memset_d2d16">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memset_d2d16</tt><big>(</big><em>dest</em>, <em>pitch</em>, <em>data</em>, <em>width</em>, <em>height</em><big>)</big><a class="headerlink" href="#pycuda.driver.memset_d2d16" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memset_d2d32">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memset_d2d32</tt><big>(</big><em>dest</em>, <em>pitch</em>, <em>data</em>, <em>width</em>, <em>height</em><big>)</big><a class="headerlink" href="#pycuda.driver.memset_d2d32" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="unstructured-memory-transfers">
<h3>Unstructured Memory Transfers<a class="headerlink" href="#unstructured-memory-transfers" title="Permalink to this headline">¶</a></h3>
<dl class="function">
<dt id="pycuda.driver.memcpy_htod">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_htod</tt><big>(</big><em>dest</em>, <em>src</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_htod" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy from the Python buffer <em>src</em> to the device pointer <em>dest</em>
(an <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 <a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>). The size of
the copy is determined by the size of the buffer.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_htod_async">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_htod_async</tt><big>(</big><em>dest</em>, <em>src</em>, <em>stream=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_htod_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy from the Python buffer <em>src</em> to the device pointer <em>dest</em>
(an <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 <a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>) asynchronously,
optionally serialized via <em>stream</em>. The size of
the copy is determined by the size of the buffer.</p>
<p><em>src</em> must be page-locked memory, see, e.g. <a class="reference internal" href="#pycuda.driver.pagelocked_empty" title="pycuda.driver.pagelocked_empty"><tt class="xref py py-func docutils literal"><span class="pre">pagelocked_empty()</span></tt></a>.</p>
<p>New in 0.93.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_dtoh">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_dtoh</tt><big>(</big><em>dest</em>, <em>src</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_dtoh" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy from the device pointer <em>src</em> (an <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
<a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>) to the Python buffer <em>dest</em>. The size of the copy
is determined by the size of the buffer.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_dtoh_async">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_dtoh_async</tt><big>(</big><em>dest</em>, <em>src</em>, <em>stream=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_dtoh_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy from the device pointer <em>src</em> (an <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
<a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>) to the Python buffer <em>dest</em> asynchronously,
optionally serialized via <em>stream</em>. The size of the copy
is determined by the size of the buffer.</p>
<p><em>dest</em> must be page-locked memory, see, e.g. <a class="reference internal" href="#pycuda.driver.pagelocked_empty" title="pycuda.driver.pagelocked_empty"><tt class="xref py py-func docutils literal"><span class="pre">pagelocked_empty()</span></tt></a>.</p>
<p>New in 0.93.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_dtod">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_dtod</tt><big>(</big><em>dest</em>, <em>src</em>, <em>size</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_dtod" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_dtod_async">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_dtod_async</tt><big>(</big><em>dest</em>, <em>src</em>, <em>size</em>, <em>stream=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_dtod_async" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 3.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_peer">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_peer</tt><big>(</big><em>dest</em>, <em>src</em>, <em>size</em>, <em>dest_context=None</em>, <em>src_context=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_peer" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_peer_async">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_peer_async</tt><big>(</big><em>dest</em>, <em>src</em>, <em>size</em>, <em>dest_context=None</em>, <em>src_context=None</em>, <em>stream=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_peer_async" title="Permalink to this definition">¶</a></dt>
<dd><p>CUDA 4.0 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_dtoa">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_dtoa</tt><big>(</big><em>ary</em>, <em>index</em>, <em>src</em>, <em>len</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_dtoa" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_atod">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_atod</tt><big>(</big><em>dest</em>, <em>ary</em>, <em>index</em>, <em>len</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_atod" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_htoa">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_htoa</tt><big>(</big><em>ary</em>, <em>index</em>, <em>src</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_htoa" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_atoh">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_atoh</tt><big>(</big><em>dest</em>, <em>ary</em>, <em>index</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_atoh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pycuda.driver.memcpy_atoa">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">memcpy_atoa</tt><big>(</big><em>dest</em>, <em>dest_index</em>, <em>src</em>, <em>src_index</em>, <em>len</em><big>)</big><a class="headerlink" href="#pycuda.driver.memcpy_atoa" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="structured-memory-transfers">
<h3>Structured Memory Transfers<a class="headerlink" href="#structured-memory-transfers" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pycuda.driver.Memcpy2D">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Memcpy2D</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D" title="Permalink to this definition">¶</a></dt>
<dd><dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.src_x_in_bytes">
<tt class="descname">src_x_in_bytes</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.src_x_in_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>X Offset of the origin of the copy. (initialized to 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.src_y">
<tt class="descname">src_y</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.src_y" title="Permalink to this definition">¶</a></dt>
<dd><p>Y offset of the origin of the copy. (initialized to 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.src_pitch">
<tt class="descname">src_pitch</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.src_pitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Size of a row in bytes at the origin of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_src_host">
<tt class="descname">set_src_host</tt><big>(</big><em>buffer</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_src_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the <em>buffer</em>, which must be a Python object adhering to the buffer interface,
to be the origin of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_src_array">
<tt class="descname">set_src_array</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_src_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> <em>array</em> to be the origin of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_src_device">
<tt class="descname">set_src_device</tt><big>(</big><em>devptr</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_src_device" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the device address <em>devptr</em> (an <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
<a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>) as the origin of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_src_unified">
<tt class="descname">set_src_unified</tt><big>(</big><em>buffer</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_src_unified" title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <a class="reference internal" href="#pycuda.driver.Memcpy2D.set_src_host" title="pycuda.driver.Memcpy2D.set_src_host"><tt class="xref py py-meth docutils literal"><span class="pre">set_src_host()</span></tt></a>, except that <em>buffer</em> may also correspond
to device memory.</p>
<p>CUDA 4.0 and above. Requires unified addressing.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.dst_x_in_bytes">
<tt class="descname">dst_x_in_bytes</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.dst_x_in_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>X offset of the destination of the copy. (initialized to 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.dst_y">
<tt class="descname">dst_y</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.dst_y" title="Permalink to this definition">¶</a></dt>
<dd><p>Y offset of the destination of the copy. (initialized to 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.dst_pitch">
<tt class="descname">dst_pitch</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.dst_pitch" title="Permalink to this definition">¶</a></dt>
<dd><p>Size of a row in bytes at the destination of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_dst_host">
<tt class="descname">set_dst_host</tt><big>(</big><em>buffer</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_dst_host" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the <em>buffer</em>, which must be a Python object adhering to the buffer interface,
to be the destination of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_dst_array">
<tt class="descname">set_dst_array</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_dst_array" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a> <em>array</em> to be the destination of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_dst_device">
<tt class="descname">set_dst_device</tt><big>(</big><em>devptr</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_dst_device" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the device address <em>devptr</em> (an <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
<a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a>) as the destination of the copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.set_dst_unified">
<tt class="descname">set_dst_unified</tt><big>(</big><em>buffer</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.set_dst_unified" title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <a class="reference internal" href="#pycuda.driver.Memcpy2D.set_dst_host" title="pycuda.driver.Memcpy2D.set_dst_host"><tt class="xref py py-meth docutils literal"><span class="pre">set_dst_host()</span></tt></a>, except that <em>buffer</em> may also correspond
to device memory.</p>
<p>CUDA 4.0 and above. Requires unified addressing.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.width_in_bytes">
<tt class="descname">width_in_bytes</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.width_in_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of bytes to copy for each row in the transfer.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy2D.height">
<tt class="descname">height</tt><a class="headerlink" href="#pycuda.driver.Memcpy2D.height" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of rows to copy.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy2D.__call__">
<tt class="descname">__call__</tt><big>(</big><span class="optional">[</span><em>aligned=True</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy2D.__call__" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform the specified memory copy, waiting for it to finish.
If <em>aligned</em> is <em>False</em>, tolerate device-side misalignment
for device-to-device copies that may lead to loss of
copy bandwidth.</p>
</dd></dl>

<dl class="method">
<dt>
<tt class="descname">__call__</tt><big>(</big><em>stream</em><big>)</big></dt>
<dd><p>Perform the memory copy asynchronously, serialized via the <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a>
<em>stream</em>. Any host memory involved in the transfer must be page-locked.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Memcpy3D">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Memcpy3D</tt><a class="headerlink" href="#pycuda.driver.Memcpy3D" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#pycuda.driver.Memcpy3D" title="pycuda.driver.Memcpy3D"><tt class="xref py py-class docutils literal"><span class="pre">Memcpy3D</span></tt></a> has the same members as <a class="reference internal" href="#pycuda.driver.Memcpy2D" title="pycuda.driver.Memcpy2D"><tt class="xref py py-class docutils literal"><span class="pre">Memcpy2D</span></tt></a>, and additionally
all of the following:</p>
<dl class="attribute">
<dt id="pycuda.driver.Memcpy3D.src_height">
<tt class="descname">src_height</tt><a class="headerlink" href="#pycuda.driver.Memcpy3D.src_height" title="Permalink to this definition">¶</a></dt>
<dd><p>Ignored when source is an <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a>. May be 0 if Depth==1.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy3D.src_z">
<tt class="descname">src_z</tt><a class="headerlink" href="#pycuda.driver.Memcpy3D.src_z" title="Permalink to this definition">¶</a></dt>
<dd><p>Z offset of the origin of the copy. (initialized to 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy3D.dst_height">
<tt class="descname">dst_height</tt><a class="headerlink" href="#pycuda.driver.Memcpy3D.dst_height" title="Permalink to this definition">¶</a></dt>
<dd><p>Ignored when destination is an <a class="reference internal" href="#pycuda.driver.Array" title="pycuda.driver.Array"><tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt></a>. May be 0 if Depth==1.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy3D.dst_z">
<tt class="descname">dst_z</tt><a class="headerlink" href="#pycuda.driver.Memcpy3D.dst_z" title="Permalink to this definition">¶</a></dt>
<dd><p>Z offset of the destination of the copy. (initialized to 0)</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Memcpy3D.depth">
<tt class="descname">depth</tt><a class="headerlink" href="#pycuda.driver.Memcpy3D.depth" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p><a class="reference internal" href="#pycuda.driver.Memcpy3D" title="pycuda.driver.Memcpy3D"><tt class="xref py py-class docutils literal"><span class="pre">Memcpy3D</span></tt></a> is supported on CUDA 2.0 and above only.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Memcpy3DPeer">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Memcpy3DPeer</tt><a class="headerlink" href="#pycuda.driver.Memcpy3DPeer" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#pycuda.driver.Memcpy3DPeer" title="pycuda.driver.Memcpy3DPeer"><tt class="xref py py-class docutils literal"><span class="pre">Memcpy3DPeer</span></tt></a> has the same members as <a class="reference internal" href="#pycuda.driver.Memcpy3D" title="pycuda.driver.Memcpy3D"><tt class="xref py py-class docutils literal"><span class="pre">Memcpy3D</span></tt></a>,
and additionally all of the following:</p>
<dl class="method">
<dt id="pycuda.driver.Memcpy3DPeer.set_src_context">
<tt class="descname">set_src_context</tt><big>(</big><em>ctx</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy3DPeer.set_src_context" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="pycuda.driver.Memcpy3DPeer.set_dst_context">
<tt class="descname">set_dst_context</tt><big>(</big><em>ctx</em><big>)</big><a class="headerlink" href="#pycuda.driver.Memcpy3DPeer.set_dst_context" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>CUDA 4.0 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

</div>
</div>
<div class="section" id="code-on-the-device-modules-and-functions">
<h2>Code on the Device: Modules and Functions<a class="headerlink" href="#code-on-the-device-modules-and-functions" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pycuda.driver.Module">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Module</tt><a class="headerlink" href="#pycuda.driver.Module" title="Permalink to this definition">¶</a></dt>
<dd><p>Handle to a CUBIN module loaded onto the device. Can be created with
<a class="reference internal" href="#pycuda.driver.module_from_file" title="pycuda.driver.module_from_file"><tt class="xref py py-func docutils literal"><span class="pre">module_from_file()</span></tt></a> and <a class="reference internal" href="#pycuda.driver.module_from_buffer" title="pycuda.driver.module_from_buffer"><tt class="xref py py-func docutils literal"><span class="pre">module_from_buffer()</span></tt></a>.</p>
<dl class="method">
<dt id="pycuda.driver.Module.get_function">
<tt class="descname">get_function</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pycuda.driver.Module.get_function" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <a class="reference internal" href="#pycuda.driver.Function" title="pycuda.driver.Function"><tt class="xref py py-class docutils literal"><span class="pre">Function</span></tt></a> <em>name</em> in this module.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">While you can obtain different handles to the same function using this
method, these handles all share the same state that is set through
the <tt class="docutils literal"><span class="pre">set_XXX</span></tt> methods of <a class="reference internal" href="#pycuda.driver.Function" title="pycuda.driver.Function"><tt class="xref py py-class docutils literal"><span class="pre">Function</span></tt></a>. This means that you
can&#8217;t obtain two different handles to the same function and
<a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">Function.prepare()</span></tt></a> them in two different ways.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Module.get_global">
<tt class="descname">get_global</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pycuda.driver.Module.get_global" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple <cite>(device_ptr, size_in_bytes)</cite> giving the device address
and size of the global <em>name</em>.</p>
<p>The main use of this method is to find the address of pre-declared
<cite>__constant__</cite> arrays so they can be filled from the host before kernel
invocation.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Module.get_texref">
<tt class="descname">get_texref</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pycuda.driver.Module.get_texref" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <a class="reference internal" href="#pycuda.driver.TextureReference" title="pycuda.driver.TextureReference"><tt class="xref py py-class docutils literal"><span class="pre">TextureReference</span></tt></a> <em>name</em> from this module.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Module.get_surfref">
<tt class="descname">get_surfref</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pycuda.driver.Module.get_surfref" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <a class="reference internal" href="#pycuda.driver.SurfaceReference" title="pycuda.driver.SurfaceReference"><tt class="xref py py-class docutils literal"><span class="pre">SurfaceReference</span></tt></a> <em>name</em> from this module.</p>
<p>CUDA 3.1 and above.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="pycuda.driver.module_from_file">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">module_from_file</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#pycuda.driver.module_from_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <a class="reference internal" href="#pycuda.driver.Module" title="pycuda.driver.Module"><tt class="xref py py-class docutils literal"><span class="pre">Module</span></tt></a> by loading the CUBIN file <em>filename</em>.</p>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.module_from_buffer">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">module_from_buffer</tt><big>(</big><em>buffer</em>, <em>options=[]</em>, <em>message_handler=None</em><big>)</big><a class="headerlink" href="#pycuda.driver.module_from_buffer" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <a class="reference internal" href="#pycuda.driver.Module" title="pycuda.driver.Module"><tt class="xref py py-class docutils literal"><span class="pre">Module</span></tt></a> by loading a PTX or CUBIN module from
<em>buffer</em>, which must support the Python buffer interface.
(For example, <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> and <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt></a> do.)</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"><ul class="first last simple">
<li><strong>options</strong> &#8211; A list of tuples (<a class="reference internal" href="#pycuda.driver.jit_option" title="pycuda.driver.jit_option"><tt class="xref py py-class docutils literal"><span class="pre">jit_option</span></tt></a>, value).</li>
<li><strong>message_handler</strong> &#8211; A callable that is called with a
arguments of <tt class="docutils literal"><span class="pre">(compile_success_bool,</span> <span class="pre">info_str,</span> <span class="pre">error_str)</span></tt>
which allows the user to process error and warning messages
from the PTX compiler.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Loading PTX modules as well as non-default values of <em>options</em> and
<em>message_handler</em> are only allowed on CUDA 2.1 and newer.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Function">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Function</tt><a class="headerlink" href="#pycuda.driver.Function" title="Permalink to this definition">¶</a></dt>
<dd><p>Handle to a <em>__global__</em> function in a <a class="reference internal" href="#pycuda.driver.Module" title="pycuda.driver.Module"><tt class="xref py py-class docutils literal"><span class="pre">Module</span></tt></a>. Create using
<a class="reference internal" href="#pycuda.driver.Module.get_function" title="pycuda.driver.Module.get_function"><tt class="xref py py-meth docutils literal"><span class="pre">Module.get_function()</span></tt></a>.</p>
<dl class="method">
<dt id="pycuda.driver.Function.__call__">
<tt class="descname">__call__</tt><big>(</big><em>arg1</em>, <em>...</em>, <em>argn</em>, <em>block=block_size</em><span class="optional">[</span>, <em>grid=(1</em>, <em>1)</em><span class="optional">[</span>, <em>stream=None</em><span class="optional">[</span>, <em>shared=0</em><span class="optional">[</span>, <em>texrefs=[]</em><span class="optional">[</span>, <em>time_kernel=False</em><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#pycuda.driver.Function.__call__" title="Permalink to this definition">¶</a></dt>
<dd><p>Launch <em>self</em>, with a thread block size of <em>block</em>. <em>block</em> must be a 3-tuple
of integers.</p>
<p><em>arg1</em> through <em>argn</em> are the positional C arguments to the kernel. See
<a class="reference internal" href="#pycuda.driver.Function.param_set" title="pycuda.driver.Function.param_set"><tt class="xref py py-meth docutils literal"><span class="pre">param_set()</span></tt></a> for details. See especially the warnings there.</p>
<p><em>grid</em> specifies, as a 2-tuple, the number of thread blocks to launch, as a
two-dimensional grid.
<em>stream</em>, if specified, is a <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a> instance serializing the
copying of input arguments (if any), execution, and the copying
of output arguments (again, if any).
<em>shared</em> gives the number of bytes available to the kernel in
<em>extern __shared__</em> arrays.
<em>texrefs</em> is 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 internal" href="#pycuda.driver.TextureReference" title="pycuda.driver.TextureReference"><tt class="xref py py-class docutils literal"><span class="pre">TextureReference</span></tt></a> instances
that the function will have access to.</p>
<p>The function returns either <em>None</em> or the number of seconds spent
executing the kernel, depending on whether <em>time_kernel</em> is <em>True</em>.</p>
<p>This is a convenience interface that can be used instead of the
<tt class="xref py py-meth docutils literal"><span class="pre">param_*()</span></tt> and <tt class="xref py py-meth docutils literal"><span class="pre">launch_*()</span></tt> methods below.  For a faster (but
mildly less convenient) way of invoking kernels, see <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> and
<a class="reference internal" href="#pycuda.driver.Function.prepared_call" title="pycuda.driver.Function.prepared_call"><tt class="xref py py-meth docutils literal"><span class="pre">prepared_call()</span></tt></a>.</p>
<p><em>arg1</em> through <em>argn</em> are allowed to be of the following types:</p>
<ul class="simple">
<li>Subclasses of <tt class="xref py py-class docutils literal"><span class="pre">numpy.number</span></tt>. These are sized number types
such as <tt class="xref py py-class docutils literal"><span class="pre">numpy.uint32</span></tt> or <tt class="xref py py-class docutils literal"><span class="pre">numpy.float32</span></tt>.</li>
<li><a class="reference internal" href="#pycuda.driver.DeviceAllocation" title="pycuda.driver.DeviceAllocation"><tt class="xref py py-class docutils literal"><span class="pre">DeviceAllocation</span></tt></a> instances, which will become a device pointer
to the allocated memory.</li>
<li>Instances of <a class="reference internal" href="#pycuda.driver.ArgumentHandler" title="pycuda.driver.ArgumentHandler"><tt class="xref py py-class docutils literal"><span class="pre">ArgumentHandler</span></tt></a> subclasses. These can be used to
automatically transfer <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.9)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> arrays onto and off of the device.</li>
<li>Objects supporting the Python <tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt> interface. These chunks
of bytes will be copied into the parameter space verbatim.</li>
<li><tt class="xref py py-class docutils literal"><span class="pre">GPUArray</span></tt> instances.</li>
</ul>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">You cannot pass values of Python&#8217;s native <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>
types to param_set. Since there is no unambiguous way to guess the size
of these integers or floats, it complains with a <a class="reference external" href="http://docs.python.org/dev/library/exceptions.html#TypeError" title="(in Python v3.5)"><tt class="xref py py-exc docutils literal"><span class="pre">TypeError</span></tt></a>.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This method has to guess the types of the arguments passed to it,
which can make it somewhat slow. For a kernel that is invoked often,
this can be inconvenient. For a faster (but mildly less convenient) way
of invoking kernels, see <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> and <a class="reference internal" href="#pycuda.driver.Function.prepared_call" title="pycuda.driver.Function.prepared_call"><tt class="xref py py-meth docutils literal"><span class="pre">prepared_call()</span></tt></a>.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.param_set_texref">
<tt class="descname">param_set_texref</tt><big>(</big><em>texref</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.param_set_texref" title="Permalink to this definition">¶</a></dt>
<dd><p>Make the <a class="reference internal" href="#pycuda.driver.TextureReference" title="pycuda.driver.TextureReference"><tt class="xref py py-class docutils literal"><span class="pre">TextureReference</span></tt></a> texref available to the function.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.prepare">
<tt class="descname">prepare</tt><big>(</big><em>arg_types</em>, <em>block=None</em>, <em>shared=None</em>, <em>texrefs=[]</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.prepare" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepare the invocation of this function by</p>
<ul>
<li><p class="first">setting up the argument types as <cite>arg_types</cite>. <cite>arg_types</cite> is expected
to be an iterable containing type characters understood by the
<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> module or <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v1.9)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.dtype</span></tt></a> objects.</p>
<p>(In addition, PyCUDA understands <em>&#8216;F&#8217;</em> and <em>&#8216;D&#8217;</em> for single- and
double precision floating point numbers.)</p>
</li>
<li><p class="first">setting the thread block shape for this function to <cite>block</cite>.</p>
</li>
<li><p class="first">Registering the texture references <cite>texrefs</cite> for use with this functions.
The <a class="reference internal" href="#pycuda.driver.TextureReference" title="pycuda.driver.TextureReference"><tt class="xref py py-class docutils literal"><span class="pre">TextureReference</span></tt></a> objects in <cite>texrefs</cite> will be retained,
and whatever these references are bound to at invocation time will
be available through the corresponding texture references within the
kernel.</p>
</li>
</ul>
<p>Return <cite>self</cite>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Passing <em>block</em> or <em>shared</em> not equal to <em>None</em> is
djprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.prepared_call">
<tt class="descname">prepared_call</tt><big>(</big><em>grid</em>, <em>block</em>, <em>*args</em>, <em>shared_size=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.prepared_call" title="Permalink to this definition">¶</a></dt>
<dd><p>Invoke <cite>self</cite> using <a class="reference internal" href="#pycuda.driver.Function.launch_grid" title="pycuda.driver.Function.launch_grid"><tt class="xref py py-meth docutils literal"><span class="pre">launch_grid()</span></tt></a>, with <cite>args</cite> a grid size of <cite>grid</cite>,
and a block size of <em>block</em>.
Assumes that <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> was called on <em>self</em>.
The texture references given to <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> are set up as parameters, as
well.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 2012.1: </span><em>shared_size</em> was added.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.prepared_timed_call">
<tt class="descname">prepared_timed_call</tt><big>(</big><em>grid</em>, <em>block</em>, <em>*args</em>, <em>shared_size=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.prepared_timed_call" title="Permalink to this definition">¶</a></dt>
<dd><p>Invoke <cite>self</cite> using <a class="reference internal" href="#pycuda.driver.Function.launch_grid" title="pycuda.driver.Function.launch_grid"><tt class="xref py py-meth docutils literal"><span class="pre">launch_grid()</span></tt></a>, with <cite>args</cite>, a grid size of <cite>grid</cite>,
and a block size of <em>block</em>.
Assumes that <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> was called on <em>self</em>.
The texture references given to <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> are set up as parameters, as
well.</p>
<p>Return a 0-ary callable that can be used to query the GPU time consumed by
the call, in seconds. Once called, this callable will block until
completion of the invocation.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 2012.1: </span><em>shared_size</em> was added.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.prepared_async_call">
<tt class="descname">prepared_async_call</tt><big>(</big><em>grid</em>, <em>block</em>, <em>stream</em>, <em>*args</em>, <em>shared_size=0</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.prepared_async_call" title="Permalink to this definition">¶</a></dt>
<dd><p>Invoke <cite>self</cite> using <a class="reference internal" href="#pycuda.driver.Function.launch_grid_async" title="pycuda.driver.Function.launch_grid_async"><tt class="xref py py-meth docutils literal"><span class="pre">launch_grid_async()</span></tt></a>, with <cite>args</cite>, a grid size
of <cite>grid</cite>, and a block size of <em>block</em>, serialized into the
<a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">pycuda.driver.Stream</span></tt></a> <cite>stream</cite>.  If <cite>stream</cite> is None, do the
same as <a class="reference internal" href="#pycuda.driver.Function.prepared_call" title="pycuda.driver.Function.prepared_call"><tt class="xref py py-meth docutils literal"><span class="pre">prepared_call()</span></tt></a>.  Assumes that <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> was called
on <em>self</em>.  The texture references given to <a class="reference internal" href="#pycuda.driver.Function.prepare" title="pycuda.driver.Function.prepare"><tt class="xref py py-meth docutils literal"><span class="pre">prepare()</span></tt></a> are set up
as parameters, as well.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 2012.1: </span><em>shared_size</em> was added.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.get_attribute">
<tt class="descname">get_attribute</tt><big>(</big><em>attr</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.get_attribute" title="Permalink to this definition">¶</a></dt>
<dd><p>Return one of the attributes given by the
<a class="reference internal" href="#pycuda.driver.function_attribute" title="pycuda.driver.function_attribute"><tt class="xref py py-class docutils literal"><span class="pre">function_attribute</span></tt></a> value <em>attr</em>.</p>
<p>All <a class="reference internal" href="#pycuda.driver.function_attribute" title="pycuda.driver.function_attribute"><tt class="xref py py-class docutils literal"><span class="pre">function_attribute</span></tt></a> values may also be directly read
as (lower-case) attributes on the <a class="reference internal" href="#pycuda.driver.Function" title="pycuda.driver.Function"><tt class="xref py py-class docutils literal"><span class="pre">Function</span></tt></a> object itself,
e.g. <cite>func.num_regs</cite>.</p>
<p>CUDA 2.2 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.93.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Function.set_cache_config">
<tt class="descname">set_cache_config</tt><big>(</big><em>fc</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.set_cache_config" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.func_cache" title="pycuda.driver.func_cache"><tt class="xref py py-class docutils literal"><span class="pre">func_cache</span></tt></a> for possible values of <em>fc</em>.</p>
<p>CUDA 3.0 (post-beta) and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 0.94.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Function.set_shared_config">
<tt class="descname">set_shared_config</tt><big>(</big><em>sc</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.set_shared_config" title="Permalink to this definition">¶</a></dt>
<dd><p>See <a class="reference internal" href="#pycuda.driver.shared_config" title="pycuda.driver.shared_config"><tt class="xref py py-class docutils literal"><span class="pre">shared_config</span></tt></a> for possible values of <em>sc</em>.</p>
<p>CUDA 4.2 and newer.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2013.1.</span></p>
</div>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Function.local_size_bytes">
<tt class="descname">local_size_bytes</tt><a class="headerlink" href="#pycuda.driver.Function.local_size_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of bytes of local memory used by this function.</p>
<p>On CUDA 2.1 and below, this is only available if this function is part
of a <a class="reference internal" href="#pycuda.compiler.SourceModule" title="pycuda.compiler.SourceModule"><tt class="xref py py-class docutils literal"><span class="pre">pycuda.compiler.SourceModule</span></tt></a>.  It replaces the now-deprecated attribute
<cite>lmem</cite>.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Function.shared_size_bytes">
<tt class="descname">shared_size_bytes</tt><a class="headerlink" href="#pycuda.driver.Function.shared_size_bytes" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of bytes of shared memory used by this function.</p>
<p>On CUDA 2.1 and below, this is only available if this function is part
of a <a class="reference internal" href="#pycuda.compiler.SourceModule" title="pycuda.compiler.SourceModule"><tt class="xref py py-class docutils literal"><span class="pre">pycuda.compiler.SourceModule</span></tt></a>.  It replaces the now-deprecated attribute
<cite>smem</cite>.</p>
</dd></dl>

<dl class="attribute">
<dt id="pycuda.driver.Function.num_regs">
<tt class="descname">num_regs</tt><a class="headerlink" href="#pycuda.driver.Function.num_regs" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of 32-bit registers used by this function.</p>
<p>On CUDA 2.1 and below, this is only available if this function is part
of a <a class="reference internal" href="#pycuda.compiler.SourceModule" title="pycuda.compiler.SourceModule"><tt class="xref py py-class docutils literal"><span class="pre">pycuda.compiler.SourceModule</span></tt></a>.  It replaces the now-deprecated attribute
<cite>registers</cite>.</p>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.set_shared_size">
<tt class="descname">set_shared_size</tt><big>(</big><em>bytes</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.set_shared_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Set <em>shared</em> to be the number of bytes available to the kernel in
<em>extern __shared__</em> arrays.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.set_block_shape">
<tt class="descname">set_block_shape</tt><big>(</big><em>x</em>, <em>y</em>, <em>z</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.set_block_shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the thread block shape for this function.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.param_set">
<tt class="descname">param_set</tt><big>(</big><em>arg1</em>, <em>... argn</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.param_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the thread block shape for this function.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.param_set_size">
<tt class="descname">param_set_size</tt><big>(</big><em>bytes</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.param_set_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Size the parameter space to <em>bytes</em>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.param_seti">
<tt class="descname">param_seti</tt><big>(</big><em>offset</em>, <em>value</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.param_seti" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the integer at <em>offset</em> in the parameter space to <em>value</em>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.param_setf">
<tt class="descname">param_setf</tt><big>(</big><em>offset</em>, <em>value</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.param_setf" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the float at <em>offset</em> in the parameter space to <em>value</em>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.launch">
<tt class="descname">launch</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.Function.launch" title="Permalink to this definition">¶</a></dt>
<dd><p>Launch a single thread block of <em>self</em>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.launch_grid">
<tt class="descname">launch_grid</tt><big>(</big><em>width</em>, <em>height</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.launch_grid" title="Permalink to this definition">¶</a></dt>
<dd><p>Launch a width*height grid of thread blocks of <em>self</em>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

<dl class="method">
<dt id="pycuda.driver.Function.launch_grid_async">
<tt class="descname">launch_grid_async</tt><big>(</big><em>width</em>, <em>height</em>, <em>stream</em><big>)</big><a class="headerlink" href="#pycuda.driver.Function.launch_grid_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Launch a width*height grid of thread blocks of <em>self</em>, sequenced
by the <a class="reference internal" href="#pycuda.driver.Stream" title="pycuda.driver.Stream"><tt class="xref py py-class docutils literal"><span class="pre">Stream</span></tt></a> <em>stream</em>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Deprecated as of version 2011.1.</p>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pycuda.driver.ArgumentHandler">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">ArgumentHandler</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.ArgumentHandler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="pycuda.driver.In">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">In</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.In" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#pycuda.driver.ArgumentHandler" title="pycuda.driver.ArgumentHandler"><tt class="xref py py-class docutils literal"><span class="pre">ArgumentHandler</span></tt></a>. Indicates that <tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt>
<em>array</em> should be copied to the compute device before invoking the kernel.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.Out">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">Out</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.Out" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#pycuda.driver.ArgumentHandler" title="pycuda.driver.ArgumentHandler"><tt class="xref py py-class docutils literal"><span class="pre">ArgumentHandler</span></tt></a>. Indicates that <tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt>
<em>array</em> should be copied off the compute device after invoking the kernel.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.driver.InOut">
<em class="property">class </em><tt class="descclassname">pycuda.driver.</tt><tt class="descname">InOut</tt><big>(</big><em>array</em><big>)</big><a class="headerlink" href="#pycuda.driver.InOut" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#pycuda.driver.ArgumentHandler" title="pycuda.driver.ArgumentHandler"><tt class="xref py py-class docutils literal"><span class="pre">ArgumentHandler</span></tt></a>. Indicates that <tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt>
<em>array</em> should be copied both onto the compute device before invoking
the kernel, and off it afterwards.</p>
</dd></dl>

</div>
</div>
<div class="section" id="profiler-control">
<h1>Profiler Control<a class="headerlink" href="#profiler-control" title="Permalink to this headline">¶</a></h1>
<p>CUDA 4.0 and newer.</p>
<dl class="function">
<dt id="pycuda.driver.initialize_profiler">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">initialize_profiler</tt><big>(</big><em>config_file</em>, <em>output_file</em>, <em>output_mode</em><big>)</big><a class="headerlink" href="#pycuda.driver.initialize_profiler" title="Permalink to this definition">¶</a></dt>
<dd><p><em>output_mode</em> is one of the attributes of <a class="reference internal" href="#pycuda.driver.profiler_output_mode" title="pycuda.driver.profiler_output_mode"><tt class="xref py py-class docutils literal"><span class="pre">profiler_output_mode</span></tt></a>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.start_profiler">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">start_profiler</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.start_profiler" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pycuda.driver.stop">
<tt class="descclassname">pycuda.driver.</tt><tt class="descname">stop</tt><big>(</big><big>)</big><a class="headerlink" href="#pycuda.driver.stop" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
</dd></dl>

</div>
<div class="section" id="module-pycuda.compiler">
<span id="just-in-time-compilation"></span><h1>Just-in-time Compilation<a class="headerlink" href="#module-pycuda.compiler" title="Permalink to this headline">¶</a></h1>
<dl class="data">
<dt id="pycuda.compiler.DEFAULT_NVCC_FLAGS">
<tt class="descclassname">pycuda.compiler.</tt><tt class="descname">DEFAULT_NVCC_FLAGS</tt><a class="headerlink" href="#pycuda.compiler.DEFAULT_NVCC_FLAGS" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2011.1.</span></p>
</div>
<p>If no <em>options</em> are given in the calls below, the value of this list-type
variable is used instead. This may be useful for injecting necessary flags
into the compilation of automatically compiled kernels, such as those used
by the module <a class="reference internal" href="array.html#module-pycuda.gpuarray" title="pycuda.gpuarray"><tt class="xref py py-mod docutils literal"><span class="pre">pycuda.gpuarray</span></tt></a>.</p>
<p>The initial value of this variable is taken from the environment variable
<span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYCUDA_DEFAULT_NVCC_FLAGS</span></tt>.</p>
<p>If you modify this variable in your code, please be aware that this is a
globally shared variable that may be modified by multiple packages. Please
exercise caution in such modifications&#8211;you risk breaking other people&#8217;s
code.</p>
</dd></dl>

<dl class="class">
<dt id="pycuda.compiler.SourceModule">
<em class="property">class </em><tt class="descclassname">pycuda.compiler.</tt><tt class="descname">SourceModule</tt><big>(</big><em>source</em>, <em>nvcc=&quot;nvcc&quot;</em>, <em>options=None</em>, <em>keep=False</em>, <em>no_extern_c=False</em>, <em>arch=None</em>, <em>code=None</em>, <em>cache_dir=None</em>, <em>include_dirs=[]</em><big>)</big><a class="headerlink" href="#pycuda.compiler.SourceModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a <tt class="xref py py-class docutils literal"><span class="pre">Module</span></tt> from the CUDA source code <em>source</em>. The Nvidia
compiler <em>nvcc</em> is assumed to be on the <span class="target" id="index-1"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt> if no path to it is
specified, and is invoked with <em>options</em> to compile the code. If <em>keep</em> is
<em>True</em>, the compiler output directory is kept, and a line indicating its
location in the file system is printed for debugging purposes.</p>
<p>Unless <em>no_extern_c</em> is <em>True</em>, the given source code is wrapped in
<em>extern &#8220;C&#8221; { ... }</em> to prevent C++ name mangling.</p>
<p><cite>arch</cite> and <cite>code</cite> specify the values to be passed for the <em class="xref std std-option">-arch</em>
and <em class="xref std std-option">-code</em> options on the <strong class="program">nvcc</strong> command line. If <cite>arch</cite> is
<cite>None</cite>, it defaults to the current context&#8217;s device&#8217;s compute capability.
If <cite>code</cite> is <cite>None</cite>, it will not be specified.</p>
<p><cite>cache_dir</cite> gives the directory used for compiler caching. It has a
sensible per-user default. If it is set to <cite>False</cite>, caching is
disabled.</p>
<p>This class exhibits the same public interface as <a class="reference internal" href="#pycuda.driver.Module" title="pycuda.driver.Module"><tt class="xref py py-class docutils literal"><span class="pre">pycuda.driver.Module</span></tt></a>, but
does not inherit from it.</p>
<p><em>Change note:</em> <a class="reference internal" href="#pycuda.compiler.SourceModule" title="pycuda.compiler.SourceModule"><tt class="xref py py-class docutils literal"><span class="pre">SourceModule</span></tt></a> was moved from <a class="reference internal" href="#module-pycuda.driver" title="pycuda.driver: Use CUDA devices from Python"><tt class="xref py py-mod docutils literal"><span class="pre">pycuda.driver</span></tt></a> to
<a class="reference internal" href="#module-pycuda.compiler" title="pycuda.compiler"><tt class="xref py py-mod docutils literal"><span class="pre">pycuda.compiler</span></tt></a> in version 0.93.</p>
</dd></dl>

<dl class="function">
<dt>
<tt class="descname">compile(source, nvcc=&quot;nvcc&quot;, options=None, keep=False,</tt></dt>
<dt>
<tt class="descname">no_extern_c=False, arch=None, code=None, cache_dir=None,</tt></dt>
<dt>
<tt class="descname">include_dirs=[])</tt></dt>
<dd><p>Perform the same compilation as the corresponding
<a class="reference internal" href="#pycuda.compiler.SourceModule" title="pycuda.compiler.SourceModule"><tt class="xref py py-class docutils literal"><span class="pre">SourceModule</span></tt></a> constructor, but only return
resulting <em>cubin</em> file as a string. In particular,
do not upload the code to the GPU.</p>
</dd></dl>

</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="#">Device Interface</a><ul>
<li><a class="reference internal" href="#version-queries">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><ul>
<li><a class="reference internal" href="#graphics-related-constants">Graphics-related constants</a></li>
</ul>
</li>
<li><a class="reference internal" href="#devices-and-contexts">Devices and Contexts</a></li>
<li><a class="reference internal" href="#concurrency-and-streams">Concurrency and Streams</a></li>
<li><a class="reference internal" href="#memory">Memory</a><ul>
<li><a class="reference internal" href="#global-device-memory">Global Device Memory</a></li>
<li><a class="reference internal" href="#pagelocked-host-memory">Pagelocked Host Memory</a><ul>
<li><a class="reference internal" href="#pagelocked-allocation">Pagelocked Allocation</a></li>
<li><a class="reference internal" href="#aligned-host-memory">Aligned Host Memory</a></li>
<li><a class="reference internal" href="#post-allocation-pagelocking">Post-Allocation Pagelocking</a></li>
</ul>
</li>
<li><a class="reference internal" href="#managed-memory">Managed Memory</a><ul>
<li><a class="reference internal" href="#managed-memory-allocation">Managed Memory Allocation</a></li>
<li><a class="reference internal" href="#managed-memory-usage">Managed Memory Usage</a></li>
</ul>
</li>
<li><a class="reference internal" href="#arrays-and-textures">Arrays and Textures</a></li>
<li><a class="reference internal" href="#initializing-device-memory">Initializing Device Memory</a></li>
<li><a class="reference internal" href="#unstructured-memory-transfers">Unstructured Memory Transfers</a></li>
<li><a class="reference internal" href="#structured-memory-transfers">Structured Memory Transfers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#code-on-the-device-modules-and-functions">Code on the Device: Modules and Functions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#profiler-control">Profiler Control</a></li>
<li><a class="reference internal" href="#module-pycuda.compiler">Just-in-time Compilation</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="tutorial.html"
                        title="previous chapter">Tutorial</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="util.html"
                        title="next chapter">Built-in Utilities</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/driver.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<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="util.html" title="Built-in Utilities"
             >next</a> |</li>
        <li class="right" >
          <a href="tutorial.html" title="Tutorial"
             >previous</a> |</li>
        <li><a href="index.html">PyCUDA 2014.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2008, Andreas Kloeckner.
      Last updated on Jan 22, 2015.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>