Fixed a bug in CKTtrunc reduction when there is nothing to reduce
This commit is contained in:
parent
dcb62b8259
commit
fb1fb2deb4
|
|
@ -54,6 +54,13 @@ CKTcircuit *ckt, double timetemp, double *timeStep
|
||||||
|
|
||||||
cudaDeviceSynchronize () ;
|
cudaDeviceSynchronize () ;
|
||||||
|
|
||||||
|
status = cudaGetLastError () ; // check for launch error
|
||||||
|
if (status != cudaSuccess)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "Kernel 1 launch failure in cuCKTtrunc\n\n") ;
|
||||||
|
return (E_NOMEM) ;
|
||||||
|
}
|
||||||
|
|
||||||
cuCKTtrunc_kernel <<< 1, thread, thread_y * sizeof(double) >>> (ckt->d_CKTtimeStepsOut, ckt->d_CKTtimeSteps, block_x) ;
|
cuCKTtrunc_kernel <<< 1, thread, thread_y * sizeof(double) >>> (ckt->d_CKTtimeStepsOut, ckt->d_CKTtimeSteps, block_x) ;
|
||||||
|
|
||||||
cudaDeviceSynchronize () ;
|
cudaDeviceSynchronize () ;
|
||||||
|
|
@ -61,7 +68,7 @@ CKTcircuit *ckt, double timetemp, double *timeStep
|
||||||
status = cudaGetLastError () ; // check for launch error
|
status = cudaGetLastError () ; // check for launch error
|
||||||
if (status != cudaSuccess)
|
if (status != cudaSuccess)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Kernel launch failure in cuCKTtrunc\n\n") ;
|
fprintf (stderr, "Kernel 2 launch failure in cuCKTtrunc\n\n") ;
|
||||||
return (E_NOMEM) ;
|
return (E_NOMEM) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,16 @@ CKTtrunc (CKTcircuit *ckt, double *timeStep)
|
||||||
double startTime ;
|
double startTime ;
|
||||||
int error = OK ;
|
int error = OK ;
|
||||||
|
|
||||||
|
#ifdef USE_CUSPICE
|
||||||
|
int doReduction, status ;
|
||||||
|
#endif
|
||||||
|
|
||||||
startTime = SPfrontEnd->IFseconds () ;
|
startTime = SPfrontEnd->IFseconds () ;
|
||||||
|
|
||||||
|
#ifdef USE_CUSPICE
|
||||||
|
doReduction = 0 ;
|
||||||
|
#endif
|
||||||
|
|
||||||
timetemp = HUGE ;
|
timetemp = HUGE ;
|
||||||
for (i = 0 ; i < DEVmaxnum ; i++)
|
for (i = 0 ; i < DEVmaxnum ; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -45,6 +53,10 @@ CKTtrunc (CKTcircuit *ckt, double *timeStep)
|
||||||
debugtemp = timetemp ;
|
debugtemp = timetemp ;
|
||||||
#endif /* STEPDEBUG */
|
#endif /* STEPDEBUG */
|
||||||
|
|
||||||
|
#ifdef USE_CUSPICE
|
||||||
|
doReduction = 1 ;
|
||||||
|
#endif
|
||||||
|
|
||||||
error = DEVices[i]->DEVtrunc (ckt->CKThead[i], ckt, &timetemp) ;
|
error = DEVices[i]->DEVtrunc (ckt->CKThead[i], ckt, &timetemp) ;
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
|
@ -63,11 +75,12 @@ CKTtrunc (CKTcircuit *ckt, double *timeStep)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_CUSPICE
|
#ifdef USE_CUSPICE
|
||||||
int status ;
|
if (doReduction)
|
||||||
|
{
|
||||||
status = cuCKTtrunc (ckt, HUGE, timeStep) ;
|
status = cuCKTtrunc (ckt, HUGE, timeStep) ;
|
||||||
if (status != 0)
|
if (status != 0)
|
||||||
return (E_NOMEM) ;
|
return (E_NOMEM) ;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
*timeStep = MIN (2 * *timeStep, timetemp) ;
|
*timeStep = MIN (2 * *timeStep, timetemp) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue