有关PGI的OpenMP目标指令的结果 [英] Results of OpenMP target directives on PGI
问题描述
我正在使用PGI编译以下程序,该程序使用OpenMP的target指令将工作卸载到GPU:
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";
}
我的编译字符串如下:
pgc++ -omp -ta=tesla,pinned,cc60 -Minfo=accel -fast test2.cpp
编译成功,但是缺少我通过OpenACC获得的一系列输出,这些输出告诉我编译器实际上如何使用指令进行操作,像这样:
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])
我如何获得有关OpenMP的类似信息? -Minfo
本身似乎没有产生任何有用的作用.
How can I get similar information for OpenMP? -Minfo
by itself didn't seem to yield anything useful.
推荐答案
-Minfo"(与"-Minfo = all"相同)或"-Minfo = mp"将为您提供OpenMP的编译器反馈消息汇编.
"-Minfo" (which is the same as "-Minfo=all"), or "-Minfo=mp" will give you compiler feedback messages for OpenMP compilation.
尽管如此,PGI仅在我们的LLVM后端编译器中支持OpenMP 4.5指令.这些是默认在基于IBM Power的系统上可用的,或者是x86上的LLVM beta编译器的一部分.可以在 http://www.pgroup.com/support/download_llvm中找到x86 beta编译器. php ,但需要获得专业版许可证.
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.
此外,我们当前的OpenMP 4.5仅针对多核CPU.我们也在进行GPU目标卸载,但是这种支持将在一段时间内不可用.
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.
这篇关于有关PGI的OpenMP目标指令的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!