Note that there are some explanatory texts on larger screens.

plurals
  1. POParallel javascript (River Trail) combine is not a function
    primarykey
    data
    text
    <p>I'm experimenting with <a href="https://github.com/RiverTrail/RiverTrail/wiki" rel="nofollow">Intel's River Trail project</a>. I installed the Firefox extension (FFv19.02). I also installed openCL for Windows. All the API methods seem to be working (map, reduce, scan, scatter, flatten, partition) , except the 'combine' method:</p> <pre><code>var par_A = new ParallelArray([3,3], function(i,j) {return j}); console.log( par_A.combine(function(i) {return this.get(i) + 1} ) ); </code></pre> <p>I get: </p> <pre><code>TypeError: par_A.combine is not a function </code></pre> <p>Any idea what the problem might be ?</p> <p><strong>UPDATE:</strong></p> <p>So the above example makes no sense because you can't iterate over a 2D array with one combine. To simplify, let's take just a 1D example:</p> <pre><code>var par_A = new ParallelArray([1,2,3,4,5]); console.log( par_A.combine(function(i) {return this.get(i) + 1} ) ); </code></pre> <p>As stated bellow, there are two API methods, the one <a href="https://github.com/rivertrail/rivertrail/wiki/ParallelArray" rel="nofollow">proposed by Intel</a>, and the <a href="http://wiki.ecmascript.org/doku.php?id=strawman%3adata_parallelism" rel="nofollow">ECMAscript draft</a>. The ECMAscript draft has no 'combine' method, but passes the index, as a second parameter to the 'map'. The equivalent of the above would be:</p> <pre><code>var par_A = new ParallelArray([1,2,3.4.5]); console.log( par_A.map(function(v, i) {return this.get(i) + 1} ) ); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload