update to allow CUSPICE compiling with
MS Visual Studio 2015 and CUDA 8.0 This is more a hack than productive code and will require some further treatment.
This commit is contained in:
parent
411e9168ae
commit
227c383c92
|
|
@ -63,7 +63,11 @@ int OUTendDomain(runDesc *plotPtr);
|
|||
int OUTattributes(runDesc *plotPtr, IFuid varName, int param, IFvalue *value);
|
||||
int OUTstopnow(void);
|
||||
void OUTerror(int flags, char *format, IFuid *names);
|
||||
void OUTerrorf(int, const char *fmt, ...) __attribute__ ((format (__printf__, 2, 3)));
|
||||
#ifdef __GNUC__
|
||||
void OUTerrorf(int, const char *fmt, ...) __attribute__((format(__printf__, 2, 3)));
|
||||
#else
|
||||
void OUTerrorf(int, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -176,7 +176,9 @@ extern double x_atanh(double);
|
|||
#define fileno _fileno
|
||||
#define getcwd _getcwd
|
||||
#define chdir _chdir
|
||||
#if (_MSC_VER < 1800)
|
||||
#define isnan _isnan
|
||||
#endif
|
||||
#define finite _finite
|
||||
#define scalb _scalb
|
||||
#define logb _logb
|
||||
|
|
@ -190,6 +192,12 @@ extern double x_atanh(double);
|
|||
#define snprintf _snprintf
|
||||
#define isatty _isatty
|
||||
#define inline __inline
|
||||
|
||||
// undo a #define bool _Bool in MS Visual Studio 2015
|
||||
#if defined(bool)
|
||||
#undef bool
|
||||
#endif
|
||||
|
||||
/* NAN not available in MS VS 2008 */
|
||||
#ifndef NAN
|
||||
static const __int64 global_nan = 0x7ff8000000000000i64;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,13 @@ extern int OUTwData(runDesc *,int,IFvalue *,void *), OUTwEnd(runDesc *), OUTendP
|
|||
extern int OUTbeginDomain(runDesc *,IFuid,int,IFvalue *);
|
||||
extern int OUTendDomain(runDesc *), OUTstopnow(void);
|
||||
extern void OUTerror(int,char *,IFuid *);
|
||||
extern void OUTerrorf(int, const char *fmt, ...) __attribute__ ((format (__printf__, 2, 3)));
|
||||
|
||||
#ifdef __GNUC__
|
||||
extern void OUTerrorf(int, const char *fmt, ...) __attribute__((format(__printf__, 2, 3)));
|
||||
#else
|
||||
extern void OUTerrorf(int, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
extern int OUTattributes(runDesc *,IFuid,int,IFvalue *);
|
||||
|
||||
extern void initw(void);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright 1991 Regents of the University of California. All rights reserved.
|
|||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/missing_math.h"
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
Copyright 2014 - NGSPICE Software
|
||||
Author: 2014 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ ACan(CKTcircuit *ckt, int restart)
|
|||
IFuid freqUid;
|
||||
static runDesc *acPlot = NULL;
|
||||
runDesc *plot = NULL;
|
||||
|
||||
#ifdef KLU
|
||||
int i ;
|
||||
#endif
|
||||
|
||||
#ifdef XSPICE
|
||||
/* gtri - add - wbk - 12/19/90 - Add IPC stuff and anal_init and anal_type */
|
||||
|
|
@ -242,7 +244,6 @@ ACan(CKTcircuit *ckt, int restart)
|
|||
ckt->CKTcurrentAnalysis = DOING_AC;
|
||||
|
||||
#ifdef KLU
|
||||
int i ;
|
||||
|
||||
if (ckt->CKTmatrix->CKTkluMODE)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ CKTload(CKTcircuit *ckt)
|
|||
{
|
||||
#ifdef USE_CUSPICE
|
||||
cusparseStatus_t cusparseStatus ;
|
||||
double alpha, beta ;
|
||||
double alpha=1.0, beta=0.0 ;
|
||||
int status ;
|
||||
alpha = 1.0 ;
|
||||
beta = 0.0 ;
|
||||
// alpha = 1.0 ;
|
||||
// beta = 0.0 ;
|
||||
#else
|
||||
int size ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -97,10 +97,23 @@ Compress (int *Ai, int *Bp, int num_rows, int n_COO)
|
|||
int
|
||||
CKTsetup(CKTcircuit *ckt)
|
||||
{
|
||||
int i;
|
||||
int error;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int status ;
|
||||
cusparseStatus_t cusparseStatus ;
|
||||
#endif
|
||||
|
||||
#ifdef XSPICE
|
||||
/* gtri - begin - Setup for adding rshunt option resistors */
|
||||
CKTnode *node;
|
||||
int num_nodes;
|
||||
/* gtri - end - Setup for adding rshunt option resistors */
|
||||
#endif
|
||||
SMPmatrix *matrix;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
ckt->total_n_values = 0 ;
|
||||
ckt->total_n_Ptr = 0 ;
|
||||
|
||||
|
|
@ -110,15 +123,7 @@ CKTsetup(CKTcircuit *ckt)
|
|||
ckt->total_n_timeSteps = 0 ;
|
||||
#endif
|
||||
|
||||
int i;
|
||||
int error;
|
||||
#ifdef XSPICE
|
||||
/* gtri - begin - Setup for adding rshunt option resistors */
|
||||
CKTnode *node;
|
||||
int num_nodes;
|
||||
/* gtri - end - Setup for adding rshunt option resistors */
|
||||
#endif
|
||||
SMPmatrix *matrix;
|
||||
|
||||
ckt->CKTnumStates=0;
|
||||
|
||||
#ifdef WANT_SENSE2
|
||||
|
|
@ -168,13 +173,24 @@ CKTsetup(CKTcircuit *ckt)
|
|||
#ifdef KLU
|
||||
if (ckt->CKTmatrix->CKTkluMODE)
|
||||
{
|
||||
fprintf (stderr, "Using KLU as Direct Linear Solver\n") ;
|
||||
|
||||
|
||||
int i ;
|
||||
int n = SMPmatSize (ckt->CKTmatrix) ;
|
||||
int nz = ckt->CKTmatrix->CKTklunz ;
|
||||
#ifdef USE_CUSPICE
|
||||
/* In the DEVsetup the Position Vectors must be assigned and copied to the GPU */
|
||||
int j, k, u, TopologyNNZ ;
|
||||
int uRHS, TopologyNNZRHS ;
|
||||
int ret ;
|
||||
Element *TopologyStruct ;
|
||||
Element *TopologyStructRHS ;
|
||||
#endif
|
||||
fprintf (stderr, "Using KLU as Direct Linear Solver\n") ;
|
||||
|
||||
ckt->CKTmatrix->CKTkluN = n ;
|
||||
|
||||
int nz = ckt->CKTmatrix->CKTklunz ;
|
||||
|
||||
|
||||
ckt->CKTmatrix->CKTkluAp = TMALLOC (int, n + 1) ;
|
||||
ckt->CKTmatrix->CKTkluAi = TMALLOC (int, nz) ;
|
||||
|
|
@ -205,12 +221,6 @@ CKTsetup(CKTcircuit *ckt)
|
|||
#ifdef USE_CUSPICE
|
||||
fprintf (stderr, "Using CUSPICE (NGSPICE on CUDA Platforms)\n") ;
|
||||
|
||||
/* In the DEVsetup the Position Vectors must be assigned and copied to the GPU */
|
||||
int j, k, u, TopologyNNZ ;
|
||||
int uRHS, TopologyNNZRHS ;
|
||||
int ret ;
|
||||
|
||||
|
||||
/* CKTloadOutput Vector allocation - DIRECTLY in the GPU memory */
|
||||
|
||||
/* CKTloadOutput for the RHS Vector allocation - DIRECTLY in the GPU memory */
|
||||
|
|
@ -272,7 +282,7 @@ CKTsetup(CKTcircuit *ckt)
|
|||
|
||||
/* COO format to CSR format Conversion using Quick Sort */
|
||||
|
||||
Element *TopologyStruct ;
|
||||
|
||||
TopologyStruct = TMALLOC (Element, TopologyNNZ) ;
|
||||
|
||||
for (i = 0 ; i < TopologyNNZ ; i++)
|
||||
|
|
@ -295,7 +305,7 @@ CKTsetup(CKTcircuit *ckt)
|
|||
|
||||
/* COO format to CSR format Conversion for the RHS using Quick Sort */
|
||||
|
||||
Element *TopologyStructRHS ;
|
||||
|
||||
TopologyStructRHS = TMALLOC (Element, TopologyNNZRHS) ;
|
||||
|
||||
for (i = 0 ; i < TopologyNNZRHS ; i++)
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/const.h"
|
||||
#include "ngspice/macros.h"
|
||||
#include "ngspice/CUSPICE/cuniinteg.cuh"
|
||||
#include "bsim4def.h"
|
||||
#include "../bsim4def.h"
|
||||
|
||||
#define MAX_EXPL 2.688117142e+43
|
||||
#define MIN_EXPL 3.720075976e-44
|
||||
|
|
@ -56,6 +56,9 @@
|
|||
} \
|
||||
}
|
||||
|
||||
/* without this linking fails */
|
||||
double CONSTvt0 = CONSTboltz * (27 /* deg c */ + CONSTCtoK ) / CHARGE;
|
||||
|
||||
extern "C"
|
||||
__device__
|
||||
static
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
Copyright 2014 - NGSPICE Software
|
||||
Author: 2014 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "CUSPICE/cucktterr.cuh"
|
||||
#include "cucktterr.cuh"
|
||||
#include "bsim4def.h"
|
||||
|
||||
extern "C"
|
||||
|
|
|
|||
|
|
@ -66,7 +66,9 @@ JOB *job;
|
|||
unsigned int idx, InstCount;
|
||||
BSIM4instance **InstArray;
|
||||
#endif
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, jRHS, l, lRHS, lTimeSteps, status ;
|
||||
#endif
|
||||
/* Search for a noise analysis request */
|
||||
for (job = ((TSKtask *)ft_curckt->ci_curTask)->jobs;job;job = job->JOBnextJob) {
|
||||
if(strcmp(job->JOBname,"Noise Analysis")==0) {
|
||||
|
|
@ -2575,7 +2577,7 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
|
|||
}
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, jRHS, l, lRHS, lTimeSteps, status ;
|
||||
// int i, j, jRHS, l, lRHS, lTimeSteps, status ;
|
||||
|
||||
/* Counting the instances */
|
||||
for (model = (BSIM4model *)inModel ; model != NULL ; model = model->BSIM4nextModel)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "capdefs.h"
|
||||
#include "../capdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#define TopologyMatrixInsert(Ptr, instance_ID, offset, Value, global_ID) \
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "capdefs.h"
|
||||
#include "../capdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "capdefs.h"
|
||||
#include "../capdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/CUSPICE/cuniinteg.cuh"
|
||||
#include "capdefs.h"
|
||||
#include "../capdefs.h"
|
||||
|
||||
extern "C"
|
||||
__global__ void cuCAPload_kernel (CAPparamGPUstruct, double *, double *, double *,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "capdefs.h"
|
||||
#include "../capdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "capdefs.h"
|
||||
#include "../capdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
Copyright 2014 - NGSPICE Software
|
||||
Author: 2014 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "CUSPICE/cucktterr.cuh"
|
||||
#include "capdefs.h"
|
||||
#include "cucktterr.cuh"
|
||||
#include "../capdefs.h"
|
||||
|
||||
extern "C"
|
||||
__global__ void cuCAPtrunc_kernel (CAPparamGPUstruct, int, double **, double *, double,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
{
|
||||
CAPmodel *model = (CAPmodel*)inModel;
|
||||
CAPinstance *here;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, k, status ;
|
||||
#endif
|
||||
/* loop through all the capacitor models */
|
||||
for( ; model != NULL; model = model->CAPnextModel ) {
|
||||
|
||||
|
|
@ -122,7 +124,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
|||
}
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, k, status ;
|
||||
// int i, j, k, status ;
|
||||
|
||||
/* Counting the instances */
|
||||
for (model = (CAPmodel *)inModel ; model != NULL ; model = model->CAPnextModel)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
Hiroshima University &
|
||||
Semiconductor Technology Academic Research Center (STARC)
|
||||
***********************************************************************/
|
||||
|
||||
//#pragma optimize( "", off )
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "hsm2def.h"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/CUSPICE/cuniinteg.cuh"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
#define CUDAMALLOCCHECK(a, b, c, d) \
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
Copyright 2014 - NGSPICE Software
|
||||
Author: 2014 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "CUSPICE/cucktterr.cuh"
|
||||
#include "inddefs.h"
|
||||
#include "cucktterr.cuh"
|
||||
#include "../inddefs.h"
|
||||
|
||||
extern "C"
|
||||
__global__ void cuINDtrunc_kernel (INDparamGPUstruct, int, double **, double *, double,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/CUSPICE/cuniinteg.cuh"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
#define CUDAMALLOCCHECK(a, b, c, d) \
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#define TopologyMatrixInsert(Ptr, instance_ID, offset, Value, global_ID) \
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "inddefs.h"
|
||||
#include "../inddefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#define TopologyMatrixInsert(Ptr, instance_ID, offset, Value, global_ID) \
|
||||
|
|
@ -36,13 +36,13 @@
|
|||
int
|
||||
MUTtopology (GENmodel *inModel, CKTcircuit *ckt, int *i, int *j)
|
||||
{
|
||||
NG_IGNORE (j) ;
|
||||
|
||||
MUTmodel *model = (MUTmodel *)inModel ;
|
||||
MUTinstance *here ;
|
||||
int k ;
|
||||
double *basePtr ;
|
||||
basePtr = ckt->CKTmatrix->CKTkluAx ;
|
||||
NG_IGNORE (j) ;
|
||||
|
||||
/* loop through all the mutual inductor models */
|
||||
for ( ; model != NULL ; model = model->MUTnextModel)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
INDinstance *here;
|
||||
int error;
|
||||
CKTnode *tmp;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, k, status ;
|
||||
#endif
|
||||
/* loop through all the inductor models */
|
||||
for ( ; model != NULL ; model = model->INDnextModel)
|
||||
{
|
||||
|
|
@ -106,7 +108,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
|||
}
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, k, status ;
|
||||
// int i, j, k, status ;
|
||||
|
||||
/* Counting the instances */
|
||||
for (model = (INDmodel *)inModel ; model != NULL ; model = model->INDnextModel)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,11 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
MUTmodel *model = (MUTmodel*)inModel;
|
||||
MUTinstance *here;
|
||||
int ktype;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, status ;
|
||||
INDmodel *indmodel ;
|
||||
INDinstance *indhere ;
|
||||
#endif
|
||||
NG_IGNORE(states);
|
||||
|
||||
/* loop through all the mutual inductor models */
|
||||
|
|
@ -71,9 +75,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
|||
}
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, status ;
|
||||
INDmodel *indmodel ;
|
||||
INDinstance *indhere ;
|
||||
|
||||
|
||||
/* Counting the instances */
|
||||
for (model = (MUTmodel *)inModel ; model != NULL ; model = model->MUTnextModel)
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ MUTtemp(GENmodel *inModel, CKTcircuit *ckt)
|
|||
MUTinstance *here;
|
||||
double ind1, ind2;
|
||||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, status ;
|
||||
#endif
|
||||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
/* loop through all the mutual inductor models */
|
||||
for( ; model != NULL; model = model->MUTnextModel ) {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "isrcdefs.h"
|
||||
#include "../isrcdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -22,11 +22,13 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/CUSPICE/cuniinteg.cuh"
|
||||
#include "isrcdefs.h"
|
||||
|
||||
#include "../isrcdefs.h"
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
#ifdef XSPICE_EXP
|
||||
/* gtri - begin - wbk - modify for supply ramping option */
|
||||
#include "ngspice/cmproto.h"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "isrcdefs.h"
|
||||
#include "../isrcdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "isrcdefs.h"
|
||||
#include "../isrcdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "isrcdefs.h"
|
||||
#include "../isrcdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#define TopologyMatrixInsertRHS(offset, instance_ID, offsetRHS, Value, global_ID) \
|
||||
|
|
@ -36,12 +36,12 @@
|
|||
int
|
||||
ISRCtopology (GENmodel *inModel, CKTcircuit *ckt, int *i, int *j)
|
||||
{
|
||||
NG_IGNORE (i) ;
|
||||
|
||||
|
||||
ISRCmodel *model = (ISRCmodel *)inModel ;
|
||||
ISRCinstance *here ;
|
||||
int k ;
|
||||
|
||||
NG_IGNORE (i) ;
|
||||
/* loop through all the voltage source models */
|
||||
for ( ; model != NULL ; model = model->ISRCnextModel)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ ISRCtemp(GENmodel *inModel, CKTcircuit *ckt)
|
|||
ISRCinstance *here;
|
||||
double radians;
|
||||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, status ;
|
||||
#endif
|
||||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
/* loop through all the voltage source models */
|
||||
for( ; model != NULL; model = model->ISRCnextModel ) {
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "resdefs.h"
|
||||
#include "../resdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "resdefs.h"
|
||||
#include "../resdefs.h"
|
||||
|
||||
extern "C"
|
||||
__global__ void cuRESload_kernel (RESparamGPUstruct, double *, int, int *, double *) ;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "resdefs.h"
|
||||
#include "../resdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "resdefs.h"
|
||||
#include "../resdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "resdefs.h"
|
||||
#include "../resdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#define TopologyMatrixInsert(Ptr, instance_ID, offset, Value, global_ID) \
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ RESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state)
|
|||
{
|
||||
RESmodel *model = (RESmodel *)inModel;
|
||||
RESinstance *here;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, status ;
|
||||
#endif
|
||||
NG_IGNORE(state);
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
|
|
@ -54,7 +56,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
|||
}
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, status ;
|
||||
// int i, j, status ;
|
||||
|
||||
/* Counting the instances */
|
||||
for (model = (RESmodel *)inModel ; model != NULL ; model = model->RESnextModel)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "vsrcdefs.h"
|
||||
#include "../vsrcdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#define COMPILED_BY_NVCC
|
||||
#include "ngspice/config.h"
|
||||
#include "ngspice/CUSPICE/cuniinteg.cuh"
|
||||
#include "vsrcdefs.h"
|
||||
#include "../vsrcdefs.h"
|
||||
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,9 @@ Copyright 1991 Regents of the University of California. All rights reserved.
|
|||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
/* From Bruce Dawson, Comparing floating point numbers,
|
||||
http://www.cygnus-software.com/papers/comparingfloats/Comparing%20floating%20point%20numbers.htm
|
||||
Original this function is named AlmostEqual2sComplement but we leave it to AlmostEqualUlps
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "vsrcdefs.h"
|
||||
#include "../vsrcdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMalloc MACRO to check it for errors --> CUDAMALLOCCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/config.h"
|
||||
#include "cuda_runtime_api.h"
|
||||
#include "vsrcdefs.h"
|
||||
#include "../vsrcdefs.h"
|
||||
#include "ngspice/CUSPICE/CUSPICE.h"
|
||||
|
||||
/* cudaMemcpy MACRO to check it for errors --> CUDAMEMCPYCHECK(name of pointer, dimension, type, status) */
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "vsrcdefs.h"
|
||||
#include "../vsrcdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
#define TopologyMatrixInsert(Ptr, instance_ID, offset, Value, global_ID) \
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ VSRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state)
|
|||
VSRCinstance *here;
|
||||
CKTnode *tmp;
|
||||
int error;
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, k, status ;
|
||||
#endif
|
||||
NG_IGNORE(state);
|
||||
|
||||
/* loop through all the voltage source models */
|
||||
|
|
@ -61,7 +63,6 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
|||
}
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, k, status ;
|
||||
|
||||
/* Counting the instances */
|
||||
for (model = (VSRCmodel *)inModel ; model != NULL ; model = model->VSRCnextModel)
|
||||
|
|
|
|||
|
|
@ -24,12 +24,12 @@ VSRCtemp(GENmodel *inModel, CKTcircuit *ckt)
|
|||
VSRCinstance *here;
|
||||
double radians;
|
||||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
#ifdef USE_CUSPICE
|
||||
int i, j, status ;
|
||||
#endif
|
||||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
/* loop through all the voltage source models */
|
||||
for( ; model != NULL; model = model->VSRCnextModel ) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue