CARLsim  6.1.0
CARLsim: a GPU-accelerated SNN simulator
snn_definitions.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHECK_CONNECTION_ID(n, total)   { assert(n >= 0); assert(n < total); }
 < Used for in the function getConnectionId More...
 
#define COND_INTEGRATION_SCALE   2
 
#define CONNECTION_CONN_PRESENT   1
 
#define CONNECTION_FIXED_PLASTIC   2
 
#define CONNECTION_INITWTS_RAMPDOWN   4
 
#define CONNECTION_INITWTS_RAMPUP   3
 
#define CONNECTION_INITWTS_RANDOM   0
 
#define CPU_RUNTIME_BASE   8
 
#define GET_CONN_GRP_ID(val)   ((val.gsId >> NUM_SYNAPSE_BITS) & GROUP_ID_MASK)
 
#define GET_CONN_NEURON_ID(val)   (val.nId)
 
#define GET_CONN_PRESENT(a)   (((a) >> CONNECTION_CONN_PRESENT) & 1)
 
#define GET_CONN_SYN_ID(val)   (val.gsId & SYNAPSE_ID_MASK)
 
#define GET_FIXED_PLASTIC(a)   (((a) >> CONNECTION_FIXED_PLASTIC) & 1)
 
#define GET_INITWTS_RAMPDOWN(a)   (((a) >> CONNECTION_INITWTS_RAMPDOWN) & 1)
 
#define GET_INITWTS_RAMPUP(a)   (((a) >> CONNECTION_INITWTS_RAMPUP) & 1)
 
#define GET_INITWTS_RANDOM(a)   (((a) >> CONNECTION_INITWTS_RANDOM) & 1)
 
#define GPU_RUNTIME_BASE   0
 
#define GROUP_ID_MASK   0x0000ffff
 
#define IS_EXCITATORY(nid, numNInhPois, numNReg, numNExcReg, numN)   (((nid) < (numNReg)) && (((nid) < (numNExcReg)) || ((nid) >= (numNReg + numNInhPois))))
 
#define IS_EXTERNAL_NEURON(nid, numN, numNAssigned)   ((nid) >= (numN) && (nid) < (numNAssigned))
 
#define IS_INHIBITORY(nid, numNInhPois, numNReg, numNExcReg, numN)   (((nid) >= (numNExcReg)) && ((nid) < (numNReg + numNInhPois)))
 
#define IS_LOCAL_NEURON(nid, numN, numNAssigned)   ((nid) < (numN))
 
#define IS_POISSON_NEURON(nid, numNReg, numNPois)   ((nid) >= (numNReg) && ((nid) < (numNReg + numNPois)))
 
#define IS_REGULAR_NEURON(nid, numNReg, numNPois)   (((nid) < (numNReg)) && ((nid) < (numNReg + numNPois)))
 
#define KERNEL_DEBUG(formatc, ...)
 
#define KERNEL_DEBUG_PRINT(fp, type, formatc, ...)   fprintf((FILE*)fp,"[" type " %s:%d] " formatc "\n",__FILE__,__LINE__,##__VA_ARGS__)
 
#define KERNEL_ERROR(formatc, ...)
 
#define KERNEL_ERROR_PRINT(fp, formatc, ...)   fprintf((FILE*)fp,"\033[31;1m[ERROR %s:%d] " formatc "\033[0m \n",__FILE__,__LINE__,##__VA_ARGS__)
 
#define KERNEL_INFO(formatc, ...)
 
#define KERNEL_INFO_PRINT(fp, formatc, ...)   fprintf((FILE*)fp,formatc "\n",##__VA_ARGS__)
 
#define KERNEL_WARN(formatc, ...)
 
#define KERNEL_WARN_PRINT(fp, formatc, ...)   fprintf((FILE*)fp,"\033[33;1m[WARNING %s:%d] " formatc "\033[0m \n",__FILE__,__LINE__,##__VA_ARGS__)
 
#define LARGE_NEGATIVE_VALUE   (-(1 << 30))
 
#define LARGE_SPIKE_MON_GRP_SIZE   5000
 
#define LONG_NEURON_MON_DURATION   100000
 
#define LONG_SPIKE_MON_DURATION   600000
 
#define MAX_BLOCKS   120
 
#define MAX_CONN_PER_SNN   128
 
#define MAX_GRP_PER_SNN   96
 
#define MAX_GRPS_PER_BLOCK   100
 
#define MAX_NET_PER_SNN   32
 
#define MAX_NEURON_MON_BUFFER_SIZE   524288000
 
#define MAX_NEURON_MON_GRP_SZIE   128
 
#define MAX_NUM_POST_SYN   100000
 
#define MAX_NUM_PRE_SYN   200000
 
#define MAX_SIMULATION_TIME   INT_MAX
 
#define MAX_SPIKE_MON_BUFFER_SIZE   52428800
 
#define MAX_SYN_DELAY   20
 
#define MAX_SYN_PER_NEURON   65535
 
#define MAX_TIME_SLICE   1000
 
#define NEURON_MAX_FIRING_RATE   500
 
#define NUM_CPU_CORES   sysconf(_SC_NPROCESSORS_ONLN)
 
#define NUM_SYNAPSE_BITS   (16)
 
#define SET_CONN_PRESENT(a)   ((a & 1) << CONNECTION_CONN_PRESENT)
 
#define SET_FIXED_PLASTIC(a)   ((a & 1) << CONNECTION_FIXED_PLASTIC)
 
#define SET_INITWTS_RAMPDOWN(a)   ((a & 1) << CONNECTION_INITWTS_RAMPDOWN)
 
#define SET_INITWTS_RAMPUP(a)   ((a & 1) << CONNECTION_INITWTS_RAMPUP)
 
#define SET_INITWTS_RANDOM(a)   ((a & 1) << CONNECTION_INITWTS_RANDOM)
 
#define STATIC_LOAD_GROUP(n)   (n.y & 0xff)
 
#define STATIC_LOAD_SIZE(n)   ((n.y >> 16) & 0xff)
 
#define STATIC_LOAD_START(n)   (n.x)
 
#define STDP(t, a, b)   ((a)*exp(-(t)*(b)))
 
#define STDPf(t, a, b)   ((a)*exp(-(t)*(b)))
 
#define STP_BUF_POS(nid, t, maxDelay)   (nid * (maxDelay + 1) + ((t + 1) % (maxDelay + 1)))
 
#define SYNAPSE_ID_MASK   0x0000ffff
 
#define TESTING_CPU_GPU_POISSON   (0)
 
#define TIMING_COUNT   1024
 

Macro Definition Documentation

◆ CHECK_CONNECTION_ID

#define CHECK_CONNECTION_ID (   n,
  total 
)    { assert(n >= 0); assert(n < total); }

Definition at line 90 of file snn_definitions.h.

◆ COND_INTEGRATION_SCALE

#define COND_INTEGRATION_SCALE   2

Definition at line 154 of file snn_definitions.h.

◆ CONNECTION_CONN_PRESENT

#define CONNECTION_CONN_PRESENT   1

Definition at line 208 of file snn_definitions.h.

◆ CONNECTION_FIXED_PLASTIC

#define CONNECTION_FIXED_PLASTIC   2

Definition at line 209 of file snn_definitions.h.

◆ CONNECTION_INITWTS_RAMPDOWN

#define CONNECTION_INITWTS_RAMPDOWN   4

Definition at line 211 of file snn_definitions.h.

◆ CONNECTION_INITWTS_RAMPUP

#define CONNECTION_INITWTS_RAMPUP   3

Definition at line 210 of file snn_definitions.h.

◆ CONNECTION_INITWTS_RANDOM

#define CONNECTION_INITWTS_RANDOM   0

Definition at line 207 of file snn_definitions.h.

◆ CPU_RUNTIME_BASE

#define CPU_RUNTIME_BASE   8

Definition at line 147 of file snn_definitions.h.

◆ GET_CONN_GRP_ID

#define GET_CONN_GRP_ID (   val)    ((val.gsId >> NUM_SYNAPSE_BITS) & GROUP_ID_MASK)

Definition at line 205 of file snn_definitions.h.

◆ GET_CONN_NEURON_ID

#define GET_CONN_NEURON_ID (   val)    (val.nId)

Definition at line 203 of file snn_definitions.h.

◆ GET_CONN_PRESENT

#define GET_CONN_PRESENT (   a)    (((a) >> CONNECTION_CONN_PRESENT) & 1)

Definition at line 220 of file snn_definitions.h.

◆ GET_CONN_SYN_ID

#define GET_CONN_SYN_ID (   val)    (val.gsId & SYNAPSE_ID_MASK)

Definition at line 204 of file snn_definitions.h.

◆ GET_FIXED_PLASTIC

#define GET_FIXED_PLASTIC (   a)    (((a) >> CONNECTION_FIXED_PLASTIC) & 1)

Definition at line 221 of file snn_definitions.h.

◆ GET_INITWTS_RAMPDOWN

#define GET_INITWTS_RAMPDOWN (   a)    (((a) >> CONNECTION_INITWTS_RAMPDOWN) & 1)

Definition at line 223 of file snn_definitions.h.

◆ GET_INITWTS_RAMPUP

#define GET_INITWTS_RAMPUP (   a)    (((a) >> CONNECTION_INITWTS_RAMPUP) & 1)

Definition at line 222 of file snn_definitions.h.

◆ GET_INITWTS_RANDOM

#define GET_INITWTS_RANDOM (   a)    (((a) >> CONNECTION_INITWTS_RANDOM) & 1)

Definition at line 219 of file snn_definitions.h.

◆ GPU_RUNTIME_BASE

#define GPU_RUNTIME_BASE   0

Definition at line 152 of file snn_definitions.h.

◆ GROUP_ID_MASK

#define GROUP_ID_MASK   0x0000ffff

Definition at line 198 of file snn_definitions.h.

◆ IS_EXCITATORY

#define IS_EXCITATORY (   nid,
  numNInhPois,
  numNReg,
  numNExcReg,
  numN 
)    (((nid) < (numNReg)) && (((nid) < (numNExcReg)) || ((nid) >= (numNReg + numNInhPois))))

Definition at line 73 of file snn_definitions.h.

◆ IS_EXTERNAL_NEURON

#define IS_EXTERNAL_NEURON (   nid,
  numN,
  numNAssigned 
)    ((nid) >= (numN) && (nid) < (numNAssigned))

Definition at line 75 of file snn_definitions.h.

◆ IS_INHIBITORY

#define IS_INHIBITORY (   nid,
  numNInhPois,
  numNReg,
  numNExcReg,
  numN 
)    (((nid) >= (numNExcReg)) && ((nid) < (numNReg + numNInhPois)))

Definition at line 72 of file snn_definitions.h.

◆ IS_LOCAL_NEURON

#define IS_LOCAL_NEURON (   nid,
  numN,
  numNAssigned 
)    ((nid) < (numN))

Definition at line 74 of file snn_definitions.h.

◆ IS_POISSON_NEURON

#define IS_POISSON_NEURON (   nid,
  numNReg,
  numNPois 
)    ((nid) >= (numNReg) && ((nid) < (numNReg + numNPois)))

Definition at line 70 of file snn_definitions.h.

◆ IS_REGULAR_NEURON

#define IS_REGULAR_NEURON (   nid,
  numNReg,
  numNPois 
)    (((nid) < (numNReg)) && ((nid) < (numNReg + numNPois)))

Definition at line 71 of file snn_definitions.h.

◆ KERNEL_DEBUG

#define KERNEL_DEBUG (   formatc,
  ... 
)
Value:
{ KERNEL_DEBUG_PRINT(fpDeb_,"DEBUG",formatc,##__VA_ARGS__); \
KERNEL_DEBUG_PRINT(fpLog_,"DEBUG",formatc,##__VA_ARGS__); }
#define KERNEL_DEBUG_PRINT(fp, type, formatc,...)

Definition at line 118 of file snn_definitions.h.

◆ KERNEL_DEBUG_PRINT

#define KERNEL_DEBUG_PRINT (   fp,
  type,
  formatc,
  ... 
)    fprintf((FILE*)fp,"[" type " %s:%d] " formatc "\n",__FILE__,__LINE__,##__VA_ARGS__)

Definition at line 125 of file snn_definitions.h.

◆ KERNEL_ERROR

#define KERNEL_ERROR (   formatc,
  ... 
)
Value:
{ KERNEL_ERROR_PRINT(fpErr_,formatc,##__VA_ARGS__); \
KERNEL_DEBUG_PRINT(fpLog_,"ERROR",formatc,##__VA_ARGS__); }
#define KERNEL_ERROR_PRINT(fp, formatc,...)

Definition at line 112 of file snn_definitions.h.

◆ KERNEL_ERROR_PRINT

#define KERNEL_ERROR_PRINT (   fp,
  formatc,
  ... 
)    fprintf((FILE*)fp,"\033[31;1m[ERROR %s:%d] " formatc "\033[0m \n",__FILE__,__LINE__,##__VA_ARGS__)

Definition at line 122 of file snn_definitions.h.

◆ KERNEL_INFO

#define KERNEL_INFO (   formatc,
  ... 
)
Value:
{ KERNEL_INFO_PRINT(fpInf_,formatc,##__VA_ARGS__); \
KERNEL_DEBUG_PRINT(fpLog_,"INFO",formatc,##__VA_ARGS__); }
#define KERNEL_INFO_PRINT(fp, formatc,...)

Definition at line 116 of file snn_definitions.h.

◆ KERNEL_INFO_PRINT

#define KERNEL_INFO_PRINT (   fp,
  formatc,
  ... 
)    fprintf((FILE*)fp,formatc "\n",##__VA_ARGS__)

Definition at line 124 of file snn_definitions.h.

◆ KERNEL_WARN

#define KERNEL_WARN (   formatc,
  ... 
)
Value:
{ KERNEL_WARN_PRINT(fpErr_,formatc,##__VA_ARGS__); \
KERNEL_DEBUG_PRINT(fpLog_,"WARN",formatc,##__VA_ARGS__); }
#define KERNEL_WARN_PRINT(fp, formatc,...)

Definition at line 114 of file snn_definitions.h.

◆ KERNEL_WARN_PRINT

#define KERNEL_WARN_PRINT (   fp,
  formatc,
  ... 
)    fprintf((FILE*)fp,"\033[33;1m[WARNING %s:%d] " formatc "\033[0m \n",__FILE__,__LINE__,##__VA_ARGS__)

Definition at line 123 of file snn_definitions.h.

◆ LARGE_NEGATIVE_VALUE

#define LARGE_NEGATIVE_VALUE   (-(1 << 30))

Definition at line 167 of file snn_definitions.h.

◆ LARGE_SPIKE_MON_GRP_SIZE

#define LARGE_SPIKE_MON_GRP_SIZE   5000

Definition at line 174 of file snn_definitions.h.

◆ LONG_NEURON_MON_DURATION

#define LONG_NEURON_MON_DURATION   100000

Definition at line 177 of file snn_definitions.h.

◆ LONG_SPIKE_MON_DURATION

#define LONG_SPIKE_MON_DURATION   600000

Definition at line 173 of file snn_definitions.h.

◆ MAX_BLOCKS

#define MAX_BLOCKS   120

Definition at line 187 of file snn_definitions.h.

◆ MAX_CONN_PER_SNN

#define MAX_CONN_PER_SNN   128

Definition at line 136 of file snn_definitions.h.

◆ MAX_GRP_PER_SNN

#define MAX_GRP_PER_SNN   96

Definition at line 137 of file snn_definitions.h.

◆ MAX_GRPS_PER_BLOCK

#define MAX_GRPS_PER_BLOCK   100

Definition at line 186 of file snn_definitions.h.

◆ MAX_NET_PER_SNN

#define MAX_NET_PER_SNN   32

Definition at line 142 of file snn_definitions.h.

◆ MAX_NEURON_MON_BUFFER_SIZE

#define MAX_NEURON_MON_BUFFER_SIZE   524288000

Definition at line 176 of file snn_definitions.h.

◆ MAX_NEURON_MON_GRP_SZIE

#define MAX_NEURON_MON_GRP_SZIE   128

Definition at line 178 of file snn_definitions.h.

◆ MAX_NUM_POST_SYN

#define MAX_NUM_POST_SYN   100000

Definition at line 128 of file snn_definitions.h.

◆ MAX_NUM_PRE_SYN

#define MAX_NUM_PRE_SYN   200000

Definition at line 129 of file snn_definitions.h.

◆ MAX_SIMULATION_TIME

#define MAX_SIMULATION_TIME   INT_MAX

Definition at line 166 of file snn_definitions.h.

◆ MAX_SPIKE_MON_BUFFER_SIZE

#define MAX_SPIKE_MON_BUFFER_SIZE   52428800

Definition at line 172 of file snn_definitions.h.

◆ MAX_SYN_DELAY

#define MAX_SYN_DELAY   20

Definition at line 130 of file snn_definitions.h.

◆ MAX_SYN_PER_NEURON

#define MAX_SYN_PER_NEURON   65535

Definition at line 200 of file snn_definitions.h.

◆ MAX_TIME_SLICE

#define MAX_TIME_SLICE   1000

Definition at line 165 of file snn_definitions.h.

◆ NEURON_MAX_FIRING_RATE

#define NEURON_MAX_FIRING_RATE   500

Definition at line 156 of file snn_definitions.h.

◆ NUM_CPU_CORES

#define NUM_CPU_CORES   sysconf(_SC_NPROCESSORS_ONLN)

Definition at line 150 of file snn_definitions.h.

◆ NUM_SYNAPSE_BITS

#define NUM_SYNAPSE_BITS   (16)

Definition at line 201 of file snn_definitions.h.

◆ SET_CONN_PRESENT

#define SET_CONN_PRESENT (   a)    ((a & 1) << CONNECTION_CONN_PRESENT)

Definition at line 214 of file snn_definitions.h.

◆ SET_FIXED_PLASTIC

#define SET_FIXED_PLASTIC (   a)    ((a & 1) << CONNECTION_FIXED_PLASTIC)

Definition at line 215 of file snn_definitions.h.

◆ SET_INITWTS_RAMPDOWN

#define SET_INITWTS_RAMPDOWN (   a)    ((a & 1) << CONNECTION_INITWTS_RAMPDOWN)

Definition at line 217 of file snn_definitions.h.

◆ SET_INITWTS_RAMPUP

#define SET_INITWTS_RAMPUP (   a)    ((a & 1) << CONNECTION_INITWTS_RAMPUP)

Definition at line 216 of file snn_definitions.h.

◆ SET_INITWTS_RANDOM

#define SET_INITWTS_RANDOM (   a)    ((a & 1) << CONNECTION_INITWTS_RANDOM)

Definition at line 213 of file snn_definitions.h.

◆ STATIC_LOAD_GROUP

#define STATIC_LOAD_GROUP (   n)    (n.y & 0xff)

Definition at line 78 of file snn_definitions.h.

◆ STATIC_LOAD_SIZE

#define STATIC_LOAD_SIZE (   n)    ((n.y >> 16) & 0xff)

Definition at line 79 of file snn_definitions.h.

◆ STATIC_LOAD_START

#define STATIC_LOAD_START (   n)    (n.x)

Definition at line 77 of file snn_definitions.h.

◆ STDP

#define STDP (   t,
  a,
 
)    ((a)*exp(-(t)*(b)))

Definition at line 158 of file snn_definitions.h.

◆ STDPf

#define STDPf (   t,
  a,
 
)    ((a)*exp(-(t)*(b)))

Definition at line 162 of file snn_definitions.h.

◆ STP_BUF_POS

#define STP_BUF_POS (   nid,
  t,
  maxDelay 
)    (nid * (maxDelay + 1) + ((t + 1) % (maxDelay + 1)))
TODO:
D is the SNN member variable for the max delay in the network, give it a better name dammit!!

Definition at line 105 of file snn_definitions.h.

◆ SYNAPSE_ID_MASK

#define SYNAPSE_ID_MASK   0x0000ffff

Definition at line 199 of file snn_definitions.h.

◆ TESTING_CPU_GPU_POISSON

#define TESTING_CPU_GPU_POISSON   (0)

Definition at line 184 of file snn_definitions.h.

◆ TIMING_COUNT

#define TIMING_COUNT   1024

Definition at line 169 of file snn_definitions.h.