You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Analogously to <code>use</code>, to make scalar values accessible to Accelerate computations they must first be embedded with the <code>constant</code> function.</p>
135
134
<divclass="sourceCode"><preclass="sourceCode haskell"><codeclass="sourceCode haskell"><spanclass="ot">use ::</span><spanclass="dt">Elt</span> t <spanclass="ot">=></span> t <spanclass="ot">-></span><spanclass="dt">Exp</span> t</code></pre></div>
136
135
<divclass="alert alert-success" role="alert">
137
-
<p><strong>Tip!</strong> For constant numeric values this is often performed automatically. Notice in the <code>dotp</code> program we did not need to use the <code>constant</code> function to inject the initial value <spanclass="math inline">\(0\)</span>. This is because GHC applies the <code>fromInteger</code> function of the <code>Num</code> typeclass (or the <code>fromRational</code> function of the <code>Fractional</code> typeclass for floating point values) to the constant value, which implements the lifting operation for us.</p>
136
+
<p><strong>Tip!</strong> For constant numeric values this is often performed automatically. Notice in the <code>dotp</code> program we did not need to use the <code>constant</code> function to inject the initial value 0. This is because GHC applies the <code>fromInteger</code> function of the <code>Num</code> typeclass (or the <code>fromRational</code> function of the <code>Fractional</code> typeclass for floating point values) to the constant value, which implements the lifting operation for us.</p>
138
137
</div>
139
138
<h2id="arrays">Arrays</h2>
140
139
<p>The <code>Array</code> is the core computational unit of Accelerate. Computations in Accelerate take the form of collective operations over arrays of the type <code>Array sh e</code>. All programs in Accelerate take zero or more arrays as input and produce one or more arrays as output. The <code>Array</code> type has two parameters:</p>
0 commit comments