Hello,
I'm sorry if this is the wrong sub forum,
because this is a very general question,
but I don't know exaclty where else to ask it.
I need to count private memory accesses in a for-loop
of an OpenCL fragment (I need just the basic accesses,
independet from the amount of work-items.)
The loop:
Code:
for(int k = 0; k < width; ++k)
sum += M[row * width + k] * N[k * width + col];
M, N are global arrays, so variables of interest for me are
k, width, sum, row, col.
My lecture script tells me, that it should be 11 private memory
accesses for every iteration
k = 3 x read, 1 x write
width = 3 x read
row = 1 x read
col = 1 x read
sum = 1 x read, 1 x write.
BUT, aren't it more accesses for k?
k=0 -> write (only one time)
k < width -> read
++k -> read and write
... +k -> read
k * ... -> read
Sorry to bother you with such a basic question.
Bookmarks