diff --git a/src/spicelib/analysis/CUSPICE/cucktsystem.c b/src/spicelib/analysis/CUSPICE/cucktsystem.c index 59466c516..fef966f35 100644 --- a/src/spicelib/analysis/CUSPICE/cucktsystem.c +++ b/src/spicelib/analysis/CUSPICE/cucktsystem.c @@ -45,7 +45,7 @@ cuCKTsystemDtoH CKTcircuit *ckt ) { - long unsigned int i, nz, n ; + long unsigned int nz, n ; cudaError_t status ; if (ckt->total_n_Ptr > 0 || ckt->total_n_PtrRHS > 0) { @@ -56,22 +56,12 @@ CKTcircuit *ckt /* Copy back the Matrix */ status = cudaMemcpy (ckt->CKTmatrix->CKTkluAx, ckt->CKTmatrix->d_CKTkluAx, nz * sizeof(double), cudaMemcpyDeviceToHost) ; CUDAMEMCPYCHECK (ckt->CKTmatrix->CKTkluAx, nz, double, status) - } else { - /* Matrix is empty */ - for (i = 0 ; i < nz ; i++) { - ckt->CKTmatrix->CKTkluAx [i] = 0 ; - } } if (ckt->total_n_PtrRHS > 0) { /* Copy back the RHS */ status = cudaMemcpy (ckt->CKTrhs, ckt->CKTmatrix->d_CKTrhs, (n + 1) * sizeof(double), cudaMemcpyDeviceToHost) ; CUDAMEMCPYCHECK (ckt->CKTrhs, (n + 1), double, status) - } else { - /* RHS is empty */ - for (i = 0 ; i < n + 1 ; i++) { - ckt->CKTrhs [i] = 0 ; - } } } diff --git a/src/spicelib/analysis/cktload.c b/src/spicelib/analysis/cktload.c index d00ae054f..9b9f1d650 100644 --- a/src/spicelib/analysis/cktload.c +++ b/src/spicelib/analysis/cktload.c @@ -53,11 +53,9 @@ CKTload(CKTcircuit *ckt) int status ; alpha = 1.0 ; beta = 0.0 ; -#else - int size ; #endif - int i; + int i, size; double startTime; CKTnode *node; int error; @@ -81,13 +79,13 @@ CKTload(CKTcircuit *ckt) status = cuCKTflush (ckt) ; if (status != 0) return (E_NOMEM) ; -#else +#endif + size = SMPmatSize (ckt->CKTmatrix) ; for (i = 0 ; i <= size ; i++) *(ckt->CKTrhs + i) = 0 ; SMPclear (ckt->CKTmatrix) ; -#endif #ifdef STEPDEBUG noncon = ckt->CKTnoncon;