I noticed that cusolverDnSgetrf_bufferSize, cusolverDnDgetrf_bufferSize, cusolverDnCgetrf_bufferSize, and cusolverDnZgetrf_bufferSize all take the matrix being factored as an argument. So, for example:

```
cusolverStatus_t
cusolverDnZgetrf_bufferSize(cusolverDnHandle_t handle,
int m,
int n,
cuDoubleComplex *A,
int lda,
int *Lwork );
```

The pointer to the complex matrix A is one of the arguments. This means that I can only know the size of the needed workspace *after* I have allocated the complex matrix A!

What I want to do is calculate ahead of time if I have enough GPU memory to hold the complex matrix A and the workspace.

Am I misunderstanding the use of cusolverDnZgetrf? How can I do what I want to do?