Microsoft Accelerator V2 Question - toArray2D

I am new to Microsoft.Accelerator. Take a look at the following code (this is F #, but it is similar to C #):

type FPA = Microsoft.ParallelArrays.FloatParallelArray

let fi = List.init 9 (fun i -> new FPA(i, [|10;10|])) 
let process (fi: FPA list) : FPA list = fi // complicated function
let newfi = process fi
let target = new DX9Target()
for newf in newfi do printfn "%A" (target.toArray2D(newf))

Basically, I create an FPA list and process it in such a way that every element in the resulting newfi list depends on all the elements in the fi list. Finally, I would like to get a summary list. And my question is: should I call toArray2D for each individual element (FPA) in the resulting FPA list? It seems to me that all the calculations are started every time I call toArray2D, which is very laborious.

Thank you for your help. Aldrich

+3
source share
1 answer

FPA , . , fi newfi. - , , newfi - , , ; fi, , fi . , fi , :

  • fi (, toArray2D) newfi .
  • , newfi - , fi.
+2

Source: https://habr.com/ru/post/1728278/


All Articles