by sebraa » Mon Jun 08, 2015 1:18 pm
I think in this case, &a and &a[0][0] are equivalent: The very first element of a C array has the same address as the array itself. You might want to read up on how (multi-dimensional) C arrays are laid out in memory, because that is the magic you need to know here.
If you do e_write(&dev, i, j, 0x2000, &a[0][0], sizeof(a[0])), then you only copy the first element of your array into each core.
If you do e_write(&dev, i, j, 0x2000, &a, M*N*sizeof(a[0][0])), then you copy the whole array into each core (*)
If you do e_write(&dev, i, j, 0x2000, &a[i][j], sizeof(a[0][0])), then you copy a[0][0] to core (0,0), a[0][1] to core (0,1) and so on.
(*) I think that sizeof(a) should work as well, but I am not sure. I tend to avoid these constructs.