Effect of pointer aliasing on performance in GPU

Hello.

I prefer doing pointer aliasing to simplify the code.

For example, let’s say that a pointer variable C has to be accessed like this:

A(i)%B(j)%C(k, l)

If I define another pointer C(:, :) as a local variable in subroutine and point it to original C, i.e, C => A(i)%B(j)%C, I can increase the readability of the code.

My question is, how does this kind of aliasing affect performance in CUDA kernel?

Hi CNJ,

I haven’t specifically looked at this so don’t know for a fact, but I would assume it would help performance, or at least not hurt, since you’re reducing the addressing need to get access to the array element.

  • Mat