# cusolver document

**URL:** <https://forums.developer.nvidia.com/t/cusolver-document/136504>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [May 23, 2020, 4:24am UTC](https://forums.developer.nvidia.com/t/cusolver-document/136504 "2020-05-23T04:24:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjiang2](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jjiang2](https://forums.developer.nvidia.com/u/jjiang2)\
**Post date:** [May 23, 2020, 4:24am UTC](https://forums.developer.nvidia.com/t/cusolver-document/136504/1 "2020-05-23T04:24:29Z")

</div>

Hi, all:

I’m new to cuda fortran. I’m trying to port my Fortran program to cuda platform. Since my code heavily depends on blas and lapack libraries, I need use cublas and cusolver libraries to ease the porting process. I downloaded and installed the free community version of PGI compilers on windows (version 19.1). I found cublas.mod and cusolverdn.mod in the include directory. But on the Fortran Cuda interface document page of PGI website ([PGI Fortran CUDA Library Interfaces Version 20.4 for x86 and NVIDIA Processors](https://www.pgroup.com/resources/docs/20.4/x86/pgi-cuda-interfaces/index.htm)), there is no introduction of the cusolver library. Can anyone tell me where I can find the fortran Cuda interface document on the cusolver library?

Thanks,

Jianhua

---

<div class="post-metadata">

**Author:** ![brentl](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@brentl](https://forums.developer.nvidia.com/u/brentl)\
**Post date:** [May 29, 2020, 8:52pm UTC](https://forums.developer.nvidia.com/t/cusolver-document/136504/2 "2020-05-29T20:52:37Z")

</div>

Sorry, the doc for the cusolver Fortran interfaces is not available yet. Suffice it to say, there are no surprises in the interfaces, they correspond 1-1 with the documented cusolver arguments. Here’s an example:

USE cusolverDn, only : cusolverDnHandle, cusolverDnCreate, cusolverDnDestroy  
USE cusolverDn, only : CUSOLVER\_EIG\_TYPE\_1, CUSOLVER\_EIG\_MODE\_VECTOR  
USE cusolverDn, only : cusolverDnZhegvd\_bufferSize, cusolverDnZhegvd  
. . .

type(cusolverDnHandle) :: cusolverDnH  
istat = cusolverDnCreate(cusolverDnH)  
. . .

istat = cusolverDnZhegvd\_buffersize(cusolverDnH, CUSOLVER\_EIG\_TYPE\_1, &  
CUSOLVER\_EIG\_MODE\_VECTOR, CUBLAS\_FILL\_MODE\_UPPER, &  
n, h\_d, ldh, s\_d, ldh, e\_d, lwork)  
. . .

istat = cusolverDnZhegvd(cusolverDnH, CUSOLVER\_EIG\_TYPE\_1, &  
CUSOLVER\_EIG\_MODE\_VECTOR, CUBLAS\_FILL\_MODE\_UPPER, &  
n, h\_d, ldh, s\_d, ldh, e\_d, work\_d, lwork, devInfo\_d)  
. . .

istat = cusolverDnDestroy(cusolverDnH)

---

<div class="post-metadata">

**Author:** ![jjiang2](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jjiang2](https://forums.developer.nvidia.com/u/jjiang2)\
**Post date:** [May 31, 2020, 2:32am UTC](https://forums.developer.nvidia.com/t/cusolver-document/136504/3 "2020-05-31T02:32:07Z")

</div>

Hi, Brentl:

Thanks for your reply and the example. I can figure it out now.

John

---

<div class="post-metadata">

**Author:** ![pinnacleman98](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@pinnacleman98](https://forums.developer.nvidia.com/u/pinnacleman98)\
**Post date:** [July 1, 2020, 1:41pm UTC](https://forums.developer.nvidia.com/t/cusolver-document/136504/4 "2020-07-01T13:41:48Z")

</div>

Hi, Brentl:

I need the Fortran interface for ZGETRF and ZGETRI in cusolver library. Could you please provide me an example of these two functions/subrotines?

Thanks in advance.

John
