An OpenACC Example (Part 2)

Originally published at: https://developer.nvidia.com/blog/openacc-example-part-2/

You may want to read the more recent post Getting Started with OpenACC by Jeff Larkin. In my previous post I added 3 lines of OpenACC directives to a Jacobi iteration code, achieving more than 2x speedup by running it on a GPU. In this post I’ll continue where I left off and demonstrate how we can use OpenACC directives clauses…

Is there a way to look at the accelerated code generated by openacc?

By default, the PGI compiler uses the LLVM backend. However, you can use the options ‘-ta=tesla:nollvm,keepgpu’ and it will generate CUDA C code instead and save the file. It basically looks like assembly written in C, but it’s something you can inspect.