- Code: Select all
module dgesv_gpu_magma
use cudafor
interface dgesv_gpu
subroutine MdgesvDev(n, nrhs, a, lda, ipiv, b, ldb, info) bind(c,name='magma_dgesv_gpu')
use iso_c_binding
integer(c_int), value :: n, nrhs, lda, ldb, info
real(c_double), device, dimension(n,n) :: a
real(c_double), device, dimension(n,nrhs) :: b
integer(c_int), device, dimension(n) :: ipiv
end subroutine MdgesvDev
subroutine cublasinit() bind(c,name='cublasInit')
end subroutine cublasinit
end interface
end module dgesv_gpu_magma
The execution of the subroutine is as follows:
- Code: Select all
Real(8), Device, Dimension(:,:), Allocatable :: jac_dev
Integer, Device, Dimension(:), Allocatable :: indx_dev
Real(8), Device, Dimension(:), Allocatable :: dy_dev
...
call cublasinit()
call MdgesvDev(ny,1,jac_dev,ny,indx_dev,dy_dev,ny,info)
My makefile includes:
- Code: Select all
-Mcuda -I$(INCLUDE_PATH) -L$(LIBRARY_PATH) -lmagma -lmagmablas -lmagma -lcublas
When I try to compile, I get:
/lib/libmagma.a(xerbla.o): In function `magma_xerbla':
xerbla.cpp:(.text+0x1c): undefined reference to `xerbla_'
/lib/libmagma.a(dgetrf_gpu.o): In function `magma_dgetrf_gpu':
dgetrf_gpu.cpp:(.text+0x2b9): undefined reference to `cuCtxSynchronize'
dgetrf_gpu.cpp:(.text+0x313): undefined reference to `dgetrf_'
dgetrf_gpu.cpp:(.text+0x7e6): undefined reference to `cuCtxSynchronize'
dgetrf_gpu.cpp:(.text+0x820): undefined reference to `dgetrf_'
dgetrf_gpu.cpp:(.text+0xa66): undefined reference to `dgetrf_'
/lib/libmagma.a(dgetrs_gpu.o): In function `magma_dgetrs_gpu':
dgetrs_gpu.cpp:(.text+0x50): undefined reference to `lsame_'
dgetrs_gpu.cpp:(.text+0xea): undefined reference to `lsame_'
dgetrs_gpu.cpp:(.text+0x109): undefined reference to `lsame_'
dgetrs_gpu.cpp:(.text+0x29d): undefined reference to `dlaswp_'
dgetrs_gpu.cpp:(.text+0x341): undefined reference to `dlaswp_'
What am I doing wrong?
