PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Function vectorizing

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
THX 1138



Joined: 30 Jun 2011
Posts: 103

PostPosted: Thu Jan 03, 2013 1:04 pm    Post subject: Function vectorizing Reply with quote

In my program,I am trying to vectorize a function that consumes a great deal of the program's execution time. I believe that I have done this on the function itself which I will call Function A.

However, another function is called inside of Function A's vectorized code area. This Function B will be inlined during the compile stage. However, it is raw c source code, not any vectorized code at all. Will this Function B have to be vectorized or not?

If Function B must be vectorized how does one do it? Since Function A already has a vectorized section that will now contain an unvectorized section,Function B, and only part of Function B can be vectorized in the best circumstances. Is it acceptable to have a large section of unvectorized code in a vectorized code section?

This is confusing.

Any help appreciated.

THX 1138
Back to top
View user's profile
PaulPa



Joined: 02 Aug 2012
Posts: 35

PostPosted: Mon Jan 07, 2013 7:46 am    Post subject: Reply with quote

HI,

is your question related to OpenACC or to vectorization in general? OpenACC currently does not support function calls within a accelerator region (except if it can be inlined).

Generally it is a good idea to write the code in a way such that the compiler can auto-vectorize the code for you. Hence, it strongly depends on the code of function B if it can be vectorized or not.

Moreover, it is not a good idea to have non-vectorized sections within vectorized sections because this would require the CPU to move the registers from the vector-registers (i.e. ymm (looking at Intel's AVX)) to the non-vector-registers.

Can you show small code snippets such that we can help you to vectorize your code.

Did you have a look at the assembly code to verify that the code has been vectorized?

Hope this helps.
Best,
Paul
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group