As Robert mentioned, I wrote an article that showed how to implement Game of Life in F # using Accelerator v2, so you can take a look at the working version. I remember that I had a similar problem, but I don’t know exactly what scenario.
In any case, if you are using DX9Target , the problem may be that this goal should not support integer operations (since emulating integer arithmetic on the GPU is definitely not possible using DX9). I believe this is also the reason why I ended up using FloatParallelArray in my implementation. Do you have a chance to try X64MulticoreTarget see if this works?
EDIT . I did some further research and (unless I missed something important), this seems to be a bug with the CompareEqual method. Here is a much simpler example that shows the problem:
open Microsoft.ParallelArrays let target = new DX9Target() let zeros = new IntParallelArray(Array2D.create 4 4 0) let trues = target.ToArray2D(ParallelArrays.CompareEqual(zeros, zeros)) trues |> Array2D.iter (printfn "%A")
The expected result will be true (several times), but if you run it, it prints true only 4 times, and then prints 12 times false . I will ask someone from the Accelerator team and post the answer here. In the meantime, you can do the same as in my example, that is, simulate logical operations using FPA and avoid using BPA and CompareEqual .
EDIT 2 . Here is the response from the Accelerator team members:
This is due to the lack of accurate whole calculations on DX9 GPUs. Due to numerical jitter, the logical comparison of the whole with itself is not always calculated as exactly equal. (...)
So, in general, you cannot rely on BPA . The only option is to do what I suggested - to model logical values using FPA (and possibly compare the number with some small delta neighborhood to avoid jitter caused by GPUs). However, this shoudl works with the X86MulticoreTarget - if you can find minimal repro showing what situations the library crashes in, it would be really useful!