2016-10-12 8 views
0

OpenACC 계산 영역 내에서 GSL 함수를 사용할 수 있는지 테스트하려고합니다. Main.c 파일에서 I는 GSL 함수를 사용하여 루프하기 (바보), 제로의 10 × 10 매트릭스를위한 메모리를 할당하고, 메모리, 100 배를 해제OpenACC는 GNU 과학 도서관 (GSL)과 호환됩니까?

#pragma acc kernels 
for(int i=0; i<100; i++){ 
    gsl_matrix *C = gsl_matrix_calloc(10, 10); 
    gsl_matrix_free(C); 
} 

시도. 그러나 내가 컴파일 할 때,

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"에 대한 첫 번째와 마지막 메시지를 할 수는 GSL 기능을 사용할 수 없습니다 의미 acc 계산 영역 내에서?

답변

0

GSL 라이브러리에 대한 직접적인 지원을 보지 못했습니다.

사용중인 GSL 루틴의 소스 코드를 가져 와서 서브 루틴이나 함수가 정의 된 "! $ acc routine"pragmas를 삽입해야합니다.

이렇게하면 컴파일러가 GPU 용 커널을 생성하도록 지시합니다. 이러한 pragma 삽입 후에는 컴파일하는 동안 -acc 플래그를 사용하여 GSL 라이브러리를 컴파일해야합니다.