PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

“Segmentation fault” when calling a device interface to cula

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
happyfish



Joined: 25 Jan 2011
Posts: 7

PostPosted: Wed Dec 05, 2012 12:36 am    Post subject: “Segmentation fault” when calling a device interface to cula Reply with quote

This code is modified from the fortran example.

PROGRAM CULA_TEST

use CULA

EXTERNAL CULA_INITIALIZE
EXTERNAL CULA_SGEQRF
EXTERNAL CULA_DEVICE_SGEQRF
EXTERNAL CULA_SHUTDOWN

INTEGER CULA_INITIALIZE
INTEGER CULA_SGEQRF
INTEGER CULA_DEVICE_SGEQRF


INTEGER M, N, K, STATUS
INTEGER,device:: M_d, N_d, K_d
PARAMETER ( M = 8192, N = 8192, K = 8192 )

REAL A(M, N)
REAL,device:: A_d(M, N)
REAL TAU(K)
REAL,device:: TAU_d(K)

A_d = A
M_d =M; N_d= N; K_d=K

STATUS = CULA_INITIALIZE()
STATUS = CULA_SGEQRF(M, N, A, M, TAU)
STATUS = CULA_DEVICE_SGEQRF(M_d, N_d, A_d, M_d, TAU_d)

CALL CULA_SHUTDOWN()
END

I want to test CULA_DEVICE_SGEQRF, thus I added the line

STATUS = CULA_DEVICE_SGEQRF(M_d, N_d, A_d, M_d, TAU_d)

However, I got "Segmentation fault". Could you tell me why, please? Thank you very much!
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6213
Location: The Portland Group Inc.

PostPosted: Wed Dec 05, 2012 10:29 am    Post subject: Reply with quote

Hi Happyfish,

In you CULA module, do you have interfaces to the CULA routines? If not, you will need to add them. Also, you'll need to remove the external and integer declarations in favor of the interfaces.

Have you read our articles on interfacing with CULA?
http://www.pgroup.com/lit/articles/insider/v3n1a5.htm
http://www.pgroup.com/lit/articles/insider/v2n3a5.htm

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group