about the addition of two matrices
5 posts
• Page 1 of 1
about the addition of two matrices
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?
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
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.
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
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
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
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
5 posts
• Page 1 of 1
Return to General CULA Discussion
Who is online
Users browsing this forum: No registered users and 2 guests