AnsweredAssumed Answered

Performance penalty of mixing vector and scalar computation on GCN

Question asked by sszymczy on Jan 27, 2014
Latest reply on Jan 28, 2014 by sszymczy

In my kernel I have vector and scalar computation intermixed like that:

 

...

vector operations on whole vectors (eg. int4)

scalar operations on individual vector elements (int4.x, int4.y, etc)

vector operation on whole vectors

scalar operations on individual vector elements

vector operation on whole vectors

...

 

I wonder if there is any performance penalty when doing scalar operations on vector elements compared with situation when only scalar variables are used. Does it take any time to extract vector element? Does it help if I copy vector elements to scalar variables first?

Outcomes