about the addition of two matrices

General discussion for CULA. Use this forum for questions, examples, feedback, and feature requests.

about the addition of two matrices

Postby xhsh » Fri Dec 07, 2012 9:11 am

I want to add two matrices, thus I wrote the following fortran interface to cublasZgeam.

interface
subroutine cublas_device_zgeam( transa, transb, m, n, alpha, A, lda, beta, B, ldb, C, ldc) bind(C,name='cublasZgeam')
use iso_c_binding
character(c_char),value::transa,transb
integer(c_int),value::m,n,lda,ldb,ldc
complex(c_double_complex),value::alpha,beta
complex(c_double_complex),device::A(lda,*),B(ldb,*),C(ldc,*)
end subroutine
end interface

With it, my code can be compiled successfully. However, when it is executed, I got "Segmentation fault". Could anybody help me to have a look into it? Where am I wrong, please?
xhsh
 
Posts: 8
Joined: Wed Feb 23, 2011 5:42 pm

Re: about the addition of two matrices

Postby john » Mon Dec 10, 2012 7:18 am

You might want to take this question to the NVIDIA forums, since they are the CUBLAS authors.

But I can say that you'll want to read up on the CUBLAS legacy API vs the new API. Your function signature appears to be incorrect - you are missing the handle parameter.
john
Administrator
 
Posts: 587
Joined: Thu Jul 23, 2009 2:31 pm

Re: about the addition of two matrices

Postby kyle » Mon Dec 10, 2012 1:32 pm

The "GEAM" function is only available in the "Cublas V2" version of CUBLAS. Check the "cublas_api.h" file to get the correct C function signature.
kyle
Administrator
 
Posts: 301
Joined: Fri Jun 12, 2009 7:47 pm

Re: about the addition of two matrices

Postby xhsh » Mon Dec 10, 2012 7:37 pm

Many thanks. Are there any examples for the V2 version, please?
xhsh
 
Posts: 8
Joined: Wed Feb 23, 2011 5:42 pm

Re: about the addition of two matrices

Postby john » Tue Dec 11, 2012 8:09 am

Please understand that we are not the authors of CUBLAS. I would recommend checking the NVIDIA CUDA forums at https://devtalk.nvidia.com/
john
Administrator
 
Posts: 587
Joined: Thu Jul 23, 2009 2:31 pm


Return to General CULA Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron