I'm experimenting a bit with Cloo (very cool project) and ran into a problem:
I'm trying to copy a 2 dimensional float array onto the device something like
float[,] weights = new float[count, count];
obviously I can't copy it via:
ComputeBuffer<float> weightsBuffer = new ComputeBuffer<float>(context, ComputeMemoryFlags.CopyHostPointer, weights);
How can I copy this array to the device?
I could manually flatten the array :
float weightsFlat = new float[count* count]; int x = 0; for (int i=0; i<count; i++) for (int j=0; j<count; j++) weightsFlat[x++] = weights[i,j];
but I would really want to avoid that.