0

I am working on a project,i am trying to parallelize the application. there are some functions which i am trying to parallelize but the problem is these function call other functions very frequently.loops are only for computation and there are many loops in one function body. I know OpenACC does not support function calls(only inline calls) within its directive,So i have came up with two approaches : a) either Just put OpenAcc Directive around the loops and get the required parallelism and ignore the function call (not just ignore it just keep it as it is )(do this in each and every function body) b) or I can put the called the function body inside the calling function then the overhead of thread creation multiple times when entering the acc directive is minimized ( by including a large number of loops in one block).but this seems to be much of a headache becuase the function bodies are large ( about 4000-5000 lines of code).

I can't figure out how to handle such scenario.

in summary i need to find an efficient way to parallelize the function calls in OpenACC

amitj
  • 75
  • 1
  • 4
  • If you leave the function calls in the parallelized regions, most likely the compiler won't be able to parallelize the loops. Which compiler are you using? The output from the compiler will be very helpful to you as you do this. – Mark Ebersole Feb 27 '13 at 16:32
  • The good news is, function call support is being added in the OpenACC 2.0 specification. – Mark Ebersole Feb 27 '13 at 16:33

1 Answers1

0

As some Mark Ebersole said, OpenACC 2.0 is the solution. The routine directive in 2.0 allows marking functions as device targets.

Community
  • 1
  • 1
wirefox
  • 444
  • 12
  • 15