
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>DeviceArray - F# GPU</title>
    <link rel="stylesheet" href="styles.css" type="text/css" />
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <!--
    acceler, a free CSS web template by ZyPOP (zypopwebtemplates.com/)

    Download: http://zypopwebtemplates.com/

    License: Creative Commons Attribution
    //-->

    <script type="text/javascript" src="Scripts/jquery.js"></script>
    <script type="text/javascript" src="Scripts/slider.js"></script>
    <script type="text/javascript" src="Scripts/superfish.js"></script>

    <script type="text/javascript" src="Scripts/custom.js"></script>
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
</head>
<body>
    <div id="container">

        <header>
            <div class="width">
                <h1><a href="http://novelfs.org/fsgpu">F# GPU</a></h1>
                <nav>
                    <ul>
                        <li>API Documentation</li>
                    </ul>
                </nav>
            </div>
            <div class="clear"></div>
           
        </header>
        <div id="body" class="width">
            <section id="content">
                <article>
                    



<h1>DeviceArray</h1>
<p>
  <span>Namespace: <a href="index.html">NovelFS.FSharpGPU</a></span><br />
</p>
<div class="xmldoc">

 Basic operations on Device Arrays
</br></div>
  <h3>Static members</h3>
  <table class="table table-bordered member-list">
    <thead>
      <tr><td>Static member</td><td>Description</td></tr>
    </thead>
    <tbody>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '12', 12)" onmouseover="showTip(event, '12', 12)">
            associativeReduce(code)
          </code>
          <div class="tip" id="12">
            <strong>Signature:</strong> (code:Expr&lt;(devicefloat -&gt; devicefloat -&gt; devicefloat)&gt;) -&gt; devicearray&lt;devicefloat&gt; -&gt; float<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Applies a function to each element of in the array and merging the results into an array of half size recursively until all elements in the array have been merged.
 Note: The function which merges the accumulator and the element MUST be associative or this function will produce unexpected results.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '13', 13)" onmouseover="showTip(event, '13', 13)">
            average()
          </code>
          <div class="tip" id="13">
            <strong>Signature:</strong> unit -&gt; devicearray&lt;devicefloat&gt; -&gt; float<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Returns the average of the elements in the devicearray.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '14', 14)" onmouseover="showTip(event, '14', 14)">
            averageBy(code)
          </code>
          <div class="tip" id="14">
            <strong>Signature:</strong> (code:Expr&lt;(devicefloat -&gt; devicefloat)&gt;) -&gt; devicearray&lt;devicefloat&gt; -&gt; float<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Returns the average of the elements generated by applying a function to each element of an array.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '15', 15)" onmouseover="showTip(event, '15', 15)">
            filter(expr)
          </code>
          <div class="tip" id="15">
            <strong>Signature:</strong> (expr:Expr&lt;(&#39;?6965 -&gt; devicebool)&gt;) -&gt; devicearray&lt;&#39;?6965&gt; -&gt; devicearray&lt;&#39;?6965&gt;<br />
                          <strong>Type parameters:</strong> '?6965          </div>
        </td>
        <td class="xmldoc">
          
 Returns a new array containing only the elements of the array for which the given predicate returns true.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '16', 16)" onmouseover="showTip(event, '16', 16)">
            length(array)
          </code>
          <div class="tip" id="16">
            <strong>Signature:</strong> array:devicearray&lt;&#39;?6954&gt; -&gt; int<br />
                          <strong>Type parameters:</strong> '?6954          </div>
        </td>
        <td class="xmldoc">
          
 Returns the length of the device array
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '17', 17)" onmouseover="showTip(event, '17', 17)">
            map(expr)
          </code>
          <div class="tip" id="17">
            <strong>Signature:</strong> (expr:Expr&lt;(&#39;?6956 -&gt; &#39;?6957)&gt;) -&gt; devicearray&lt;&#39;?6956&gt; -&gt; devicearray&lt;&#39;?6957&gt;<br />
                          <strong>Type parameters:</strong> '?6956, '?6957          </div>
        </td>
        <td class="xmldoc">
          
 Builds a new array whose elements are the results of applying the given function to each element of the array.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '18', 18)" onmouseover="showTip(event, '18', 18)">
            map2(expr)
          </code>
          <div class="tip" id="18">
            <strong>Signature:</strong> (expr:Expr&lt;(&#39;?6959 -&gt; &#39;?6959 -&gt; &#39;?6960)&gt;) -&gt; devicearray&lt;&#39;?6959&gt; -&gt; devicearray&lt;&#39;?6959&gt; -&gt; devicearray&lt;&#39;?6960&gt;<br />
                          <strong>Type parameters:</strong> '?6959, '?6960          </div>
        </td>
        <td class="xmldoc">
          
 Builds a new array whose elements are the results of applying the given function to each element of the array.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '19', 19)" onmouseover="showTip(event, '19', 19)">
            mapNeighbours(...)
          </code>
          <div class="tip" id="19">
            <strong>Signature:</strong> neighbourSpec:NeighbourMapping&lt;&#39;?6962,&#39;?6963&gt; -&gt; mapLengthSpec:MappingLength -&gt; array:devicearray&lt;&#39;?6962&gt; -&gt; devicearray&lt;&#39;?6963&gt;<br />
                          <strong>Type parameters:</strong> '?6962, '?6963          </div>
        </td>
        <td class="xmldoc">
          
 Builds a new array whose elements are the results of applying the given function to each element of the array and a specified number of its neighbours
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '20', 20)" onmouseover="showTip(event, '20', 20)">
            ofArray(array)
          </code>
          <div class="tip" id="20">
            <strong>Signature:</strong> (array:bool []) -&gt; devicearray&lt;devicefloat&gt;<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Converts a standard host array of bools into a device array of devicebools
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '21', 21)" onmouseover="showTip(event, '21', 21)">
            ofArray(array)
          </code>
          <div class="tip" id="21">
            <strong>Signature:</strong> (array:float []) -&gt; devicearray&lt;devicefloat&gt;<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Converts a standard host array of floats into a device array of devicefloats
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '22', 22)" onmouseover="showTip(event, '22', 22)">
            sum()
          </code>
          <div class="tip" id="22">
            <strong>Signature:</strong> unit -&gt; devicearray&lt;devicefloat&gt; -&gt; float<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Returns the sum of each element of the device array.
</br>
        </td>
      </tr>
      <tr>
        <td class="member-name">

          <code onmouseout="hideTip(event, '23', 23)" onmouseover="showTip(event, '23', 23)">
            sumBy(code)
          </code>
          <div class="tip" id="23">
            <strong>Signature:</strong> (code:Expr&lt;(devicefloat -&gt; devicefloat)&gt;) -&gt; devicearray&lt;devicefloat&gt; -&gt; float<br />
                      </div>
        </td>
        <td class="xmldoc">
          
 Returns the sum of the results generated by applying the function to each element of the device array.
</br>
        </td>
      </tr>
    </tbody>
  </table>

                </article>
            </section>

            <div class="clear"></div>
        </div>
        <footer>
            <div class="footer-content width">

                <div class="clear"></div>
            </div>
            <div class="footer-bottom">
                <p>&copy; Philip Curzon 2015. Web design based upon: <a href="http://zypopwebtemplates.com/">Free HTML5 Templates</a> by ZyPOP</p>
            </div>
        </footer>
    </div>
</body>
</html>
