[log in to unmask] wrote:
> From: Peter Bismuti <[log in to unmask]>
>
> I have a situation like this
>
> DO i = 1,100
> C(:,:,i) = MATMUL(B(:,:,i),A(:,:))
> ENDDO
>
> In other words I have a matrix multiplication that is repeated many
> times where one of the matrices stays constant. If possible, I
> would like to coerce the data from matrix A into cache (assume it all
> fits) and have it stay there for the entire calculation.
>
> Depends on the sizes of A, B and C. If the dimensions are small then
> A should stay resident in cache. It is not automatically evicted,
> only if the cache space is needed for other data.
This is an interesting question, and there is one aspect that isn't
addressed in this response. The reference to MATMUL almost certainly
results in a call to a library procedure that isn't inlined. I've
always believed (I don't know where I picked this up, or if it's even
true) that procedure references usually end up trashing cache contents
because there is actually a lot of stuff that goes on behind the scenes
during procedure calls and returns (saving/restoring the stack, etc.)
Could someone comment on what impact procedure references have on cache
contents? I'd hope that for pure intrinsic procedures such as above
that it would be minimal, but it's not clear to me that this is the case.
---------------------------------------------------------------------------
Neil N. Carlson [log in to unmask]
Department of Mathematics 765-494-1920 (Fax: 4-0548)
Purdue University
---------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|