filter two dim array

Feb 6, 2014 at 9:25 PM
Edited Feb 6, 2014 at 9:53 PM
Hello,

I would like to filter a two dim array with this code in Cudafy:
 for (int x = 0; x < Z; x++)
 {
                        if (dev_BOM[x, 0] == (prod[calcProduct]))
                        {
                            Component[x] = dev_BOM[x, 1];
                            ComponentQ[x] = dev_CompQ[x];
                            ComponentN[x] = dev_norm[x];
                        }
}
The dev_BOM[x, 0] part translated as this:
for (int j = 0; j < Z; j++)
        {
            if (dev_BOM[(j) * dev_BOMLen1 + (0)] == prod[(i)])
            {
                array[(j)] = dev_BOM[(j) * dev_BOMLen1 + (1)];
                array2[(j)] = dev_CompQ[(j)];
                array3[(j)] = dev_norm[(j)];
            }
        }
And I have got an error message, that dev_BOMLen1 is not defined.

My dev_BOM is:
[Cudafy]
public static int[,] dev_BOM;

I am using the 1.25 CUDAfy.Net release with CUDA 5.5.

Can you please help me out?

Thanks in advance!
Br,
Peter
Feb 7, 2014 at 5:20 AM
Hello,

The dev_BOMLen1 was missing because I have not initialize this array.

Br,
Peter
Marked as answer by PeterCserna on 2/6/2014 at 10:20 PM
Coordinator
Feb 7, 2014 at 6:22 PM
Correct!