I am testing to see if I can even use GSL functions within OpenACC compute regions. In Main.c I try the following (silly) for loop which uses GSL functions,
#pragma acc kernels
for(int i=0; i<100; i++){
gsl_matrix *C = gsl_matrix_calloc(10, 10);
gsl_matrix_free(C);
}
which allocates memory for a 10x10 matrix of zeroes, and then frees the memory, 100 times. However when I compile,
pgcc -pg -fast -acc -Minfo=all,intensity -lgsl -lgslcblas -lm -o Main Main.c
I get the following messages,
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
In particular, do the first and last messages regarding "acc routine information", mean it is not possible to use GSL functions within acc compute regions?
I haven't seen direct support for the GSL libraries.
You will need to obtain the source code for the GSL routines that you are using and insert "!$acc routine" pragmas where the subroutines or functions are defined.
This will instruct the compiler to generate kernels for the GPU. Following those pragma insertions, you should compile the GSL libraries using the -acc flag during compilation.