Results of OpenMP target directives on PGI

帅比萌擦擦* 提交于 2019-12-11 08:44:55

问题


I'm using PGI to compile the following program which uses OpenMP's target directives to offload work to a GPU:

#include <iostream>
#include <cmath>

int main(){
  const int SIZE = 400000;

  double *m;
  m = new double[SIZE];

  #pragma omp target teams distribute parallel for
  for(int i=0;i<SIZE;i++)
    m[i] = std::sin((double)i);

  for(int i=0;i<SIZE;i++)
    std::cout<<m[i]<<"\n";
}

My compilation string is as follows:

pgc++ -omp -ta=tesla,pinned,cc60 -Minfo=accel  -fast test2.cpp

Compilation succeeds, but it lacks the series of outputs that I get with OpenACC that tell me what the compiler actually did with the directive, like so:

main:
  8, Accelerator kernel generated
     Generating Tesla code
     11, #pragma acc loop gang, vector(128) /* blockIdx.x threadIdx.x */
  8, Generating implicit copyout(m[:400000])

How can I get similar information for OpenMP? -Minfo by itself didn't seem to yield anything useful.


回答1:


"-Minfo" (which is the same as "-Minfo=all"), or "-Minfo=mp" will give you compiler feedback messages for OpenMP compilation.

Though, PGI only supports OpenMP 4.5 directives with our LLVM back-end compilers. These are available by default on IBM Power based systems or as a part of our LLVM beta compilers on x86. The x86 beta compilers can be found at http://www.pgroup.com/support/download_llvm.php but do require a Professional Edition license.

Also, our current OpenMP 4.5 only targets multicore CPU. We're working on GPU target offload as well but this support wont be available for awhile.



来源:https://stackoverflow.com/questions/47962231/results-of-openmp-target-directives-on-pgi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!