Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 3abba1c7a0f7ec4c649289f5b8a17d86 > files > 119

python-opencl-2013.1-8.mga5.i586.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>Multi-dimensional arrays &mdash; PyOpenCL 2013.1 documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/akdoc.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2013.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="PyOpenCL 2013.1 documentation" href="index.html" />
    <link rel="next" title="Parallel Algorithms" href="algorithm.html" />
    <link rel="prev" title="OpenCL Runtime" href="runtime.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="algorithm.html" title="Parallel Algorithms"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="runtime.html" title="OpenCL Runtime"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">PyOpenCL 2013.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pyopencl.array">
<span id="multi-dimensional-arrays"></span><h1>Multi-dimensional arrays<a class="headerlink" href="#module-pyopencl.array" title="Permalink to this headline">¶</a></h1>
<p>The functionality in this module provides something of a work-alike for
<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.8)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> arrays, but with all operations executed on the CL compute device.</p>
<div class="section" id="data-types">
<h2>Data Types<a class="headerlink" href="#data-types" title="Permalink to this headline">¶</a></h2>
<p>PyOpenCL provides some amount of integration between the <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.8)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a>
type system, as represented by <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.dtype</span></tt></a>, and the types
available in OpenCL. All the simple scalar types map straightforwardly
to their CL counterparts.</p>
<div class="section" id="vector-types">
<span id="id1"></span><h3>Vector Types<a class="headerlink" href="#vector-types" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="pyopencl.array.vec">
<em class="property">class </em><tt class="descclassname">pyopencl.array.</tt><tt class="descname">vec</tt><a class="headerlink" href="#pyopencl.array.vec" title="Permalink to this definition">¶</a></dt>
<dd><p>All of OpenCL&#8217;s supported vector types, such as <cite>float3</cite> and <cite>long4</cite> are
available as <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.8)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> data types within this class. These
<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.dtype</span></tt></a> instances have field names of <cite>x</cite>, <cite>y</cite>, <cite>z</cite>, and <cite>w</cite>
just like their OpenCL counterparts. They will work both for parameter passing
to kernels as well as for passing data back and forth between kernels and
Python code. For each type, a <cite>make_type</cite> function is also provided (e.g.
<cite>make_float3(x,y,z)</cite>).</p>
</dd></dl>

</div>
<div class="section" id="custom-data-types">
<h3>Custom data types<a class="headerlink" href="#custom-data-types" title="Permalink to this headline">¶</a></h3>
<p>If you would like to use your own (struct/union/whatever) data types in array
operations where you supply operation source code, define those types in the
<em>preamble</em> passed to <tt class="xref py py-class docutils literal"><span class="pre">pyopencl.elementwise.ElementwiseKernel</span></tt>,
<a class="reference internal" href="algorithm.html#pyopencl.reduction.ReductionKernel" title="pyopencl.reduction.ReductionKernel"><tt class="xref py py-class docutils literal"><span class="pre">pyopencl.reduction.ReductionKernel</span></tt></a> (or similar), and let PyOpenCL know
about them using this function:</p>
<dl class="exception">
<dt id="pyopencl.tools.TypeNameNotKnown">
<em class="property">exception </em><tt class="descclassname">pyopencl.tools.</tt><tt class="descname">TypeNameNotKnown</tt><a class="headerlink" href="#pyopencl.tools.TypeNameNotKnown" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 2013.1.</span></p>
</div>
</dd></dl>

<dl class="function">
<dt id="pyopencl.tools.register_dtype">
<tt class="descclassname">pyopencl.tools.</tt><tt class="descname">register_dtype</tt><big>(</big><em>dtype</em>, <em>name</em><big>)</big><a class="headerlink" href="#pyopencl.tools.register_dtype" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionchanged">
<p><span class="versionmodified">Changed in version 2013.1: </span>This function has been deprecated. It is recommended that you develop
against the new interface, <tt class="xref py py-func docutils literal"><span class="pre">get_or_register_dtype()</span></tt>.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="pyopencl.tools.dtype_to_ctype">
<tt class="descclassname">pyopencl.tools.</tt><tt class="descname">dtype_to_ctype</tt><big>(</big><em>dtype</em><big>)</big><a class="headerlink" href="#pyopencl.tools.dtype_to_ctype" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a C name registered for <em>dtype</em>.</p>
</dd></dl>

<p>This function helps with producing C/OpenCL declarations for structured
<a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v1.8)"><tt class="xref py py-class docutils literal"><span class="pre">numpy.dtype</span></tt></a> instances:</p>
<p>A more complete example of how to use custom structured types can be
found in <tt class="file docutils literal"><span class="pre">examples/demo-struct-reduce.py</span></tt> in the PyOpenCL
distribution.</p>
</div>
<div class="section" id="complex-numbers">
<h3>Complex Numbers<a class="headerlink" href="#complex-numbers" title="Permalink to this headline">¶</a></h3>
<p>PyOpenCL&#8217;s <tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt> type supports complex numbers out of the box, by
simply using the corresponding <a class="reference external" href="http://docs.scipy.org/doc/numpy/reference/index.html#module-numpy" title="(in NumPy v1.8)"><tt class="xref py py-mod docutils literal"><span class="pre">numpy</span></tt></a> types.</p>
<p>If you would like to use this support in your own kernels, here&#8217;s how to
proceed: Since OpenCL 1.2 (and earlier) do not specify native complex number
support, PyOpenCL works around that deficiency. By saying:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c">#include &lt;pyopencl-complex.h&gt;</span>
</pre></div>
</div>
<p>in your kernel, you get complex types <cite>cfloat_t</cite> and <cite>cdouble_t</cite>, along with
functions defined on them such as <cite>cfloat_mul(a, b)</cite> or <cite>cdouble_log(z)</cite>.
Elementwise kernels automatically include the header if your kernel has
complex input or output.
See the <a class="reference external" href="https://github.com/inducer/pyopencl/blob/master/src/cl/pyopencl-complex.h">source file</a>
for a precise list of what&#8217;s available.</p>
<p>If you need double precision support, please:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c">#define PYOPENCL_DEFINE_CDOUBLE</span>
</pre></div>
</div>
<p>before including the header, as DP support apparently cannot be reliably
autodetected.</p>
<p>Under the hood, the complex types are simply <cite>float2</cite> and <cite>double2</cite>.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Note that addition (real + complex) and multiplication (complex*complex)
are defined for e.g. <cite>float2</cite>, but yield wrong results, so that you need to
use the corresponding functions.</p>
</div>
<div class="versionadded">
<p><span class="versionmodified">New in version 2012.1.</span></p>
</div>
</div>
</div>
<div class="section" id="the-array-class">
<h2>The <tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt> Class<a class="headerlink" href="#the-array-class" title="Permalink to this headline">¶</a></h2>
<div class="section" id="constructing-array-instances">
<h3>Constructing <tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt> Instances<a class="headerlink" href="#constructing-array-instances" title="Permalink to this headline">¶</a></h3>
<dl class="function">
<dt id="pyopencl.array.empty">
<tt class="descclassname">pyopencl.array.</tt><tt class="descname">empty</tt><big>(</big><em>queue</em>, <em>shape</em>, <em>dtype</em>, <em>order=&quot;C&quot;</em>, <em>allocator=None</em>, <em>data=None</em><big>)</big><a class="headerlink" href="#pyopencl.array.empty" title="Permalink to this definition">¶</a></dt>
<dd><p>A synonym for the <tt class="xref py py-class docutils literal"><span class="pre">Array</span></tt> constructor.</p>
</dd></dl>

</div>
<div class="section" id="conditionals">
<h3>Conditionals<a class="headerlink" href="#conditionals" title="Permalink to this headline">¶</a></h3>
</div>
<div class="section" id="reductions">
<span id="id2"></span><h3>Reductions<a class="headerlink" href="#reductions" title="Permalink to this headline">¶</a></h3>
<p>See also <a class="reference internal" href="algorithm.html#custom-reductions"><em>Sums and counts (&#8220;reduce&#8221;)</em></a>.</p>
</div>
</div>
<div class="section" id="module-pyopencl.clmath">
<span id="elementwise-functions-on-arrray-instances"></span><h2>Elementwise Functions on <tt class="xref py py-class docutils literal"><span class="pre">Arrray</span></tt> Instances<a class="headerlink" href="#module-pyopencl.clmath" title="Permalink to this headline">¶</a></h2>
<p>The <a class="reference internal" href="#module-pyopencl.clmath" title="pyopencl.clmath"><tt class="xref py py-mod docutils literal"><span class="pre">pyopencl.clmath</span></tt></a> module contains exposes array versions of the C
functions available in the OpenCL standard. (See table 6.8 in the spec.)</p>
<dl class="function">
<dt id="pyopencl.clmath.acos">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">acos</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.acos" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.acosh">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">acosh</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.acosh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.acospi">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">acospi</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.acospi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.asin">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">asin</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.asin" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.asinh">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">asinh</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.asinh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.asinpi">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">asinpi</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.asinpi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.atan">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">atan</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.atan" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.atanh">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">atanh</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.atanh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.atanpi">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">atanpi</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.atanpi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.cbrt">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">cbrt</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.cbrt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.ceil">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">ceil</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.ceil" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.cos">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">cos</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.cos" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.cosh">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">cosh</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.cosh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.cospi">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">cospi</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.cospi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.erfc">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">erfc</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.erfc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.erf">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">erf</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.erf" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.exp">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">exp</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.exp" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.exp2">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">exp2</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.exp2" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.exp10">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">exp10</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.exp10" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.expm1">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">expm1</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.expm1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.fabs">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">fabs</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.fabs" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.floor">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">floor</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.floor" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.fmod">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">fmod</tt><big>(</big><em>arg</em>, <em>mod</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.fmod" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the floating point remainder of the division <cite>arg/mod</cite>,
for each element in <cite>arg</cite> and <cite>mod</cite>.</p>
</dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.frexp">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">frexp</tt><big>(</big><em>arg</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.frexp" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple <cite>(significands, exponents)</cite> such that
<cite>arg == significand * 2**exponent</cite>.</p>
</dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.ilogb">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">ilogb</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.ilogb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.ldexp">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">ldexp</tt><big>(</big><em>significand</em>, <em>exponent</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.ldexp" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a new array of floating point values composed from the
entries of <cite>significand</cite> and <cite>exponent</cite>, paired together as
<cite>result = significand * 2**exponent</cite>.</p>
</dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.lgamma">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">lgamma</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.lgamma" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.log">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">log</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.log" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.log2">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">log2</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.log2" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.log10">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">log10</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.log10" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.log1p">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">log1p</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.log1p" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.logb">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">logb</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.logb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.modf">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">modf</tt><big>(</big><em>arg</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.modf" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a tuple <cite>(fracpart, intpart)</cite> of arrays containing the
integer and fractional parts of <cite>arg</cite>.</p>
</dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.nan">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">nan</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.nan" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.rint">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">rint</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.rint" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.round">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">round</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.round" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.sin">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">sin</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.sin" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.sinh">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">sinh</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.sinh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.sinpi">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">sinpi</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.sinpi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.sqrt">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">sqrt</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.sqrt" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.tan">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">tan</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.tan" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.tanh">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">tanh</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.tanh" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.tanpi">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">tanpi</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.tanpi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.tgamma">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">tgamma</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.tgamma" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="pyopencl.clmath.trunc">
<tt class="descclassname">pyopencl.clmath.</tt><tt class="descname">trunc</tt><big>(</big><em>array</em>, <em>queue=None</em><big>)</big><a class="headerlink" href="#pyopencl.clmath.trunc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="section" id="generating-arrays-of-random-numbers">
<h2>Generating Arrays of Random Numbers<a class="headerlink" href="#generating-arrays-of-random-numbers" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="fast-fourier-transforms">
<h2>Fast Fourier Transforms<a class="headerlink" href="#fast-fourier-transforms" title="Permalink to this headline">¶</a></h2>
<p>Bogdan Opanchuk&#8217;s <a class="reference external" href="http://pypi.python.org/pypi/pyfft">pyfft</a> package offers a
variety of GPU-based FFT implementations.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Multi-dimensional arrays</a><ul>
<li><a class="reference internal" href="#data-types">Data Types</a><ul>
<li><a class="reference internal" href="#vector-types">Vector Types</a></li>
<li><a class="reference internal" href="#custom-data-types">Custom data types</a></li>
<li><a class="reference internal" href="#complex-numbers">Complex Numbers</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-array-class">The <tt class="docutils literal"><span class="pre">Array</span></tt> Class</a><ul>
<li><a class="reference internal" href="#constructing-array-instances">Constructing <tt class="docutils literal"><span class="pre">Array</span></tt> Instances</a></li>
<li><a class="reference internal" href="#conditionals">Conditionals</a></li>
<li><a class="reference internal" href="#reductions">Reductions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-pyopencl.clmath">Elementwise Functions on <tt class="docutils literal"><span class="pre">Arrray</span></tt> Instances</a></li>
<li><a class="reference internal" href="#generating-arrays-of-random-numbers">Generating Arrays of Random Numbers</a></li>
<li><a class="reference internal" href="#fast-fourier-transforms">Fast Fourier Transforms</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="runtime.html"
                        title="previous chapter">OpenCL Runtime</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="algorithm.html"
                        title="next chapter">Parallel Algorithms</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="algorithm.html" title="Parallel Algorithms"
             >next</a> |</li>
        <li class="right" >
          <a href="runtime.html" title="OpenCL Runtime"
             >previous</a> |</li>
        <li><a href="index.html">PyOpenCL 2013.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009, Andreas Kloeckner.
      Last updated on Oct 15, 2014.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
  </body>
</html>