我正在测试是否可以在OpenACC计算区域中使用GSL函数。在Main.c中,我尝试了以下(愚蠢的) for循环,它使用GSL函数,
#pragma acc kernels
for(int i=0; i<100; i++){
gsl_matrix *C = gsl_matrix_calloc(10, 10);
gsl_matrix_free(C);
}它为10x10的零矩阵分配内存,然后释放内存100次。然而,当我编译时,
pgcc -pg -fast -acc -Minfo=all,intensity -lgsl -lgslcblas -lm -o Main Main.c我收到以下消息,
PGC-S-0155-Procedures called in a compute region must have acc routine information: gsl_matrix_calloc (Main.c: 60)
PGC-S-0155-Accelerator region ignored; see -Minfo messages (Main.c: 57)
main:
57, Accelerator region ignored
58, Intensity = 1.00
Loop not vectorized/parallelized: contains call
60, Accelerator restriction: call to 'gsl_matrix_calloc' with no acc routine information特别地,第一条和最后一条关于"acc例程信息“的消息是否意味着在acc计算区域内不能使用GSL函数?
发布于 2016-10-28 22:43:20
我还没有看到对GSL库的直接支持。
您需要获取正在使用的GSL例程的源代码,并在定义子例程或函数的位置插入"!$acc例程“编译指示。
这将指示编译器为GPU生成内核。在这些杂注插入之后,您应该在编译期间使用-acc标志来编译GSL库。
https://stackoverflow.com/questions/39999127
复制相似问题