logger->log("DEBUG: Proc-"+to_string(mpidata->rank)+" found "+to_string(device_count)+" CUDA devices.\n",LOG_DEBG);
#elif defined USE_MAGMA
//===========
// Initialise MAGMA
//===========
#ifdef USE_MAGMA
// GMu note: MAGMA does not necessarily rely on CUDA, it may just as well run on openCL or HIP, we should consider alternative ways to detect the number of devices if MAGMA is not using CUDA but something else
cudaGetDeviceCount(&device_count);
logger->log("DEBUG: Proc-"+to_string(mpidata->rank)+" found "+to_string(device_count)+" CUDA devices.\n",LOG_DEBG);
/*! \brief Invert a complex matrix with double precision elements, applying iterative refinement of the solution
*
* Use CUBLAS to perform matrix inversion for a complex
* matrix with double precision elements.
*
* \param mat: Matrix of complex. The matrix to be inverted.
* \param n: `np_int` The number of rows and columns of the [n x n] matrix.
* \param maxrefiters: `int` Maximum number of refinement iterations to apply.
* \param accuracygoal: `double` Accuracy to achieve in iterative refinement, defined as the module of the maximum difference between the identity matrix and the matrix product of the (approximate) inverse times the original matrix. On return, it contains the actually achieved accuracy
* \param device_id: `int` ID of the device for matrix inversion offloading.