Loading src/libnptm/cublas_calls.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ void cublas_zinvert(dcomplex **mat, np_int n, int device_id, const RuntimeSettin cublascall(CUIZAMAX(handle, mm, d_a_residual, 1, &maxindex)); cuDoubleComplex cublasmax; // transfer the maximum value to the host cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex-1, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); // take the module oldmax = cabs( (((double *) &(cublasmax))[0]) + I*(((double *) &(cublasmax))[1])); //printf("Initial max residue = %g\n", oldmax); Loading @@ -170,7 +170,7 @@ void cublas_zinvert(dcomplex **mat, np_int n, int device_id, const RuntimeSettin cublascall(CUIZAMAX(handle, mm, d_a_residual, 1, &maxindex)); // transfer the maximum value to the host cuDoubleComplex cublasmax; cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex-1, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); // take the module double newmax = cabs( (((double *) &(cublasmax))[0]) + I*(((double *) &(cublasmax))[1])); sprintf(buffer, "DEBUG: Maximum residue after %d iterations = %.5le\n", iter+1, newmax); Loading Loading
src/libnptm/cublas_calls.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ void cublas_zinvert(dcomplex **mat, np_int n, int device_id, const RuntimeSettin cublascall(CUIZAMAX(handle, mm, d_a_residual, 1, &maxindex)); cuDoubleComplex cublasmax; // transfer the maximum value to the host cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex-1, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); // take the module oldmax = cabs( (((double *) &(cublasmax))[0]) + I*(((double *) &(cublasmax))[1])); //printf("Initial max residue = %g\n", oldmax); Loading @@ -170,7 +170,7 @@ void cublas_zinvert(dcomplex **mat, np_int n, int device_id, const RuntimeSettin cublascall(CUIZAMAX(handle, mm, d_a_residual, 1, &maxindex)); // transfer the maximum value to the host cuDoubleComplex cublasmax; cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); cudacall(cudaMemcpy(&cublasmax, d_a_residual+maxindex-1, sizeof(cuDoubleComplex), cudaMemcpyDeviceToHost)); // take the module double newmax = cabs( (((double *) &(cublasmax))[0]) + I*(((double *) &(cublasmax))[1])); sprintf(buffer, "DEBUG: Maximum residue after %d iterations = %.5le\n", iter+1, newmax); Loading