Your code goes here single matrix eig parameter
| 7 | // Your code goes here |
| 8 | // single matrix eig parameter |
| 9 | class SingleEigParam { |
| 10 | public: |
| 11 | int gpu_id; |
| 12 | cusolverEigMode_t jobz; |
| 13 | cublasFillMode_t uplo; |
| 14 | cusolverDnParams_t param; |
| 15 | |
| 16 | SingleEigParam(const int gpu_id = 0): gpu_id(gpu_id) { |
| 17 | CHECK_CUDA( cudaSetDevice(this->gpu_id) ); |
| 18 | this->param = NULL; |
| 19 | CHECK_CUSOLVER( cusolverDnCreateParams(&this->param) ); |
| 20 | // we need eigen vector |
| 21 | this->jobz = CUSOLVER_EIG_MODE_VECTOR; |
| 22 | // upper and lower is arbitrary |
| 23 | this->uplo = CUBLAS_FILL_MODE_LOWER; |
| 24 | } |
| 25 | |
| 26 | ~SingleEigParam() { |
| 27 | if (this->param != NULL) { |
| 28 | CHECK_CUSOLVER( cusolverDnDestroyParams(this->param) ); |
| 29 | this->param = NULL; |
| 30 | } |
| 31 | } |
| 32 | }; |
| 33 | |
| 34 | // get single matrix eig buffer sizes in cusolver |
| 35 | template <typename T> |
nothing calls this directly
no outgoing calls
no test coverage detected