CARLsim
4.1.0
CARLsim: a GPU-accelerated SNN simulator
|
Go to the documentation of this file.
163 short int connect(
int gIDpre,
int gIDpost,
const std::string& _type,
float initWt,
float maxWt,
float prob,
164 uint8_t minDelay, uint8_t maxDelay,
RadiusRF radius,
165 float mulSynFast,
float mulSynSlow,
bool synWtType);
230 void setConductances(
bool isSet,
int tdAMPA,
int trNMDA,
int tdNMDA,
int tdGABAa,
int trGABAb,
int tdGABAb);
239 void setHomeostasis(
int grpId,
bool isSet,
float homeoScale,
float avgTimeScale);
260 void setNeuronParameters(
int grpId,
float izh_a,
float izh_a_sd,
float izh_b,
float izh_b_sd,
261 float izh_c,
float izh_c_sd,
float izh_d,
float izh_d_sd);
275 void setNeuronParametersLIF(
int grpId,
int tau_m,
int tau_ref,
float vTh,
float vReset,
double minRmem,
double maxRmem);
301 void setNeuronParameters(
int grpId,
float izh_C,
float izh_C_sd,
float izh_k,
float izh_k_sd,
302 float izh_vr,
float izh_vr_sd,
float izh_vt,
float izh_vt_sd,
303 float izh_a,
float izh_a_sd,
float izh_b,
float izh_b_sd,
304 float izh_vpeak,
float izh_vpeak_sd,
float izh_c,
float izh_c_sd,
305 float izh_d,
float izh_d_sd);
319 void setNeuromodulator(
int grpId,
float baseDP,
float tauDP,
float base5HT,
float tau5HT,
320 float baseACh,
float tauACh,
float baseNE,
float tauNE);
334 void setESTDP(
int grpId,
bool isSet,
STDPType type,
STDPCurve curve,
float alphaPlus,
float tauPlus,
float alphaMinus,
float tauMinus,
float gamma);
371 void setSTP(
int grpId,
bool isSet,
float STP_U,
float STP_tau_u,
float STP_tau_x);
388 int runNetwork(
int _nsec,
int _nmsec,
bool printRunSummary);
399 void biasWeights(
short int connId,
float bias,
bool updateWeightRange =
false);
414 void scaleWeights(
short int connId,
float scale,
bool updateWeightRange =
false);
462 void setWeight(
short int connId,
int neurIdPre,
int neurIdPost,
float weight,
bool updateWeightRange =
false);
525 void setLogsFp(FILE* fpInf = NULL, FILE* fpErr = NULL, FILE* fpDeb = NULL, FILE* fpLog = NULL);
545 uint8_t*
getDelays(
int gGrpIdPre,
int gGrpIdPost,
int& numPreN,
int& numPostN);
655 void allocateManagerRuntimeData();
657 int assignGroup(
int gGrpId,
int availableNeuronId);
658 int assignGroup(std::list<GroupConfigMD>::iterator grpIt,
int localGroupId,
int availableNeuronId);
659 void generateGroupRuntime(
int netId,
int lGrpId);
660 void generatePoissonGroupRuntime(
int netId,
int lGrpId);
661 void generateConnectionRuntime(
int netId);
662 void generateCompConnectionRuntime(
int netId);
667 void generateRuntimeNetworkConfigs();
668 void generateRuntimeGroupConfigs();
669 void generateRuntimeConnectConfigs();
674 void collectGlobalNetworkConfigC();
675 void compileConnectConfig();
676 void compileGroupConfig();
678 void collectGlobalNetworkConfigP();
683 void connectNetwork();
684 inline void connectNeurons(
int netId,
int srcGrp,
int destGrp,
int srcN,
int destN,
short int connId,
int externalNetId);
685 inline void connectNeurons(
int netId,
int _grpSrc,
int _grpDest,
int _nSrc,
int _nDest,
short int _connId,
float initWt,
float maxWt, uint8_t delay,
int externalNetId);
686 void connectFull(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
687 void connectOneToOne(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
688 void connectRandom(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
689 void connectGaussian(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
690 void connectUserDefined(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
692 void deleteObjects();
694 void findMaxNumSynapsesGroups(
int* _maxNumPostSynGrp,
int* _maxNumPreSynGrp);
695 void findMaxNumSynapsesNeurons(
int _netId,
int& _maxNumPostSynN,
int& _maxNumPreSynN);
696 void findMaxSpikesD1D2(
int netId,
unsigned int& _maxSpikesD1,
unsigned int& _maxSpikesD2);
697 void findNumSynapsesNetwork(
int netId,
int& _numPostSynNet,
int& _numPreSynNet);
698 void findNumN(
int _netId,
int& _numN,
int& _nunNExternal,
int& numNAssigned,
699 int& _numNReg,
int& _numNExcReg,
int& _numNInhReg,
700 int& _numNPois,
int& _numNExcPois,
int& _numNInhPois);
701 void findNumNSpikeGenAndOffset(
int _netId);
703 void generatePostSynapticSpike(
int preNId,
int postNId,
int synId,
int tD,
int netId);
704 void fillSpikeGenBits(
int netId);
705 void userDefinedSpikeGenerator(
int gGrpId);
707 float generateWeight(
int connProp,
float initWt,
float maxWt,
int nid,
int grpId);
710 void verifyNetwork();
716 void verifyHomeostasis();
719 void verifyCompartments();
728 void generateRuntimeSNN();
750 void printConnectionInfo(
short int connId);
751 void printConnectionInfo(
int netId, std::list<ConnectConfig>::iterator connIt);
752 void printGroupInfo(
int grpId);
753 void printGroupInfo(
int netId, std::list<GroupConfigMD>::iterator grpIt);
754 void printSimSummary();
755 void printStatusConnectionMonitor(
int connId =
ALL);
756 void printStatusGroupMonitor(
int gGrpId =
ALL);
757 void printStatusSpikeMonitor(
int gGrpId =
ALL);
758 void printSikeRoutingInfo();
760 int loadSimulation_internal(
bool onlyPlastic);
762 void resetConductances(
int netId);
763 void resetCurrent(
int netId);
764 void resetFiringInformation();
765 void resetGroupConfigs(
bool deallocate =
false);
766 void resetNeuromodulator(
int netId,
int lGrpId);
767 void resetNeuron(
int netId,
int lGrpId,
int lNId);
768 void resetMonitors(
bool deallocate =
false);
769 void resetConnectionConfigs(
bool deallocate =
false);
770 void deleteManagerRuntimeData();
771 void resetPoissonNeuron(
int netId,
int lGrpId,
int lNId);
772 void resetPropogationBuffer();
773 void resetSynapse(
int netId,
bool changeWeights =
false);
774 void resetTimeTable();
775 void resetFiringTable();
777 void transferSpikes(
void* dest,
int destNetId,
void* src,
int srcNetId,
int size);
780 inline SynInfo SET_CONN_ID(
int nid,
int sid,
int grpId);
782 void setGrpTimeSlice(
int grpId,
int timeSlice);
783 int setRandSeed(
int seed);
788 void generateUserDefinedSpikes();
790 void allocateManagerSpikeTables();
794 float getCompCurrent(
int netid,
int lGrpId,
int lneurId,
float const0 = 0.0f,
float const1 = 0.0f);
797 void allocateSNN(
int netId);
798 void clearExtFiringTable();
799 void convertExtSpikesD1(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
800 void convertExtSpikesD2(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
801 void doCurrentUpdate();
802 void doSTPUpdateAndDecayCond();
803 void deleteRuntimeData();
805 void globalStateUpdate();
806 void resetSpikeCnt(
int gGrpId);
807 void shiftSpikeTables();
808 void spikeGeneratorUpdate();
809 void updateTimingTable();
810 void updateWeights();
811 void updateNetworkConfig(
int netId);
814 void fetchConductanceAMPA(
int gGrpId);
815 void fetchConductanceNMDA(
int gGrpId);
816 void fetchConductanceGABAa(
int gGrpId);
817 void fetchConductanceGABAb(
int gGrpId);
818 void fetchNetworkSpikeCount();
819 void fetchNeuronSpikeCount(
int gGrpId);
820 void fetchSTPState(
int gGrpId);
823 void fetchSpikeTables(
int netId);
824 void fetchNeuronStateBuffer(
int netId,
int lGrpId);
825 void fetchGroupState(
int netId,
int lGrpId);
826 void fetchWeightState(
int netId,
int lGrpId);
827 void fetchGrpIdsLookupArray(
int netId);
828 void fetchConnIdsLookupArray(
int netId);
829 void fetchLastSpikeTime(
int netId);
830 void fetchPreConnectionInfo(
int netId);
831 void fetchPostConnectionInfo(
int netId);
832 void fetchSynapseState(
int netId);
833 void fetchExtFiringTable(
int netId);
834 void fetchTimeTable(
int netId);
835 void writeBackTimeTable(
int netId);
839 void allocateSNN_GPU(
int netId);
840 void assignPoissonFiringRate_GPU(
int netId);
841 void clearExtFiringTable_GPU(
int netId);
842 void convertExtSpikesD1_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
843 void convertExtSpikesD2_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
844 void doCurrentUpdateD1_GPU(
int netId);
845 void doCurrentUpdateD2_GPU(
int netId);
846 void doSTPUpdateAndDecayCond_GPU(
int netId);
847 void deleteRuntimeData_GPU(
int netId);
848 void findFiring_GPU(
int netId);
849 void globalStateUpdate_C_GPU(
int netId);
850 void globalStateUpdate_N_GPU(
int netId);
851 void globalStateUpdate_G_GPU(
int netId);
852 void resetSpikeCnt_GPU(
int netId,
int lGrpId);
853 void shiftSpikeTables_F_GPU(
int netId);
854 void shiftSpikeTables_T_GPU(
int netId);
855 void spikeGeneratorUpdate_GPU(
int netId);
856 void updateTimingTable_GPU(
int netId);
857 void updateWeights_GPU(
int netId);
859 void allocateSNN_GPU(
int netId) { assert(
false); }
860 void assignPoissonFiringRate_GPU(
int netId) { assert(
false); }
861 void clearExtFiringTable_GPU(
int netId) { assert(
false); }
862 void convertExtSpikesD1_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset) { assert(
false); }
863 void convertExtSpikesD2_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset) { assert(
false); }
864 void doCurrentUpdateD1_GPU(
int netId) { assert(
false); }
865 void doCurrentUpdateD2_GPU(
int netId) { assert(
false); }
866 void doSTPUpdateAndDecayCond_GPU(
int netId) { assert(
false); }
867 void deleteRuntimeData_GPU(
int netId) { assert(
false); }
868 void findFiring_GPU(
int netId) { assert(
false); }
869 void globalStateUpdate_C_GPU(
int netId) { assert(
false); }
870 void globalStateUpdate_N_GPU(
int netId) { assert(
false); }
871 void globalStateUpdate_G_GPU(
int netId) { assert(
false); }
872 void resetSpikeCnt_GPU(
int netId,
int lGrpId) { assert(
false); }
873 void shiftSpikeTables_F_GPU(
int netId) { assert(
false); }
874 void shiftSpikeTables_T_GPU(
int netId) { assert(
false); }
875 void spikeGeneratorUpdate_GPU(
int netId) { assert(
false); }
876 void updateTimingTable_GPU(
int netId) { assert(
false); }
877 void updateWeights_GPU(
int netId) { assert(
false); }
882 void allocateGroupId(
int netId);
883 int allocateStaticLoad(
int netId,
int bufSize);
884 void checkAndSetGPUDevice(
int netId);
885 void checkDestSrcPtrs(
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int grpId,
int destOffset);
886 int configGPUDevice();
887 void initGPU(
int netId);
889 int configGPUDevice() {
return 0; }
894 void copyAuxiliaryData(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
895 void copyConductanceAMPA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
896 void copyConductanceNMDA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
897 void copyConductanceGABAa(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
898 void copyConductanceGABAb(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
899 void copyPreConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
900 void copyPostConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
901 void copyExternalCurrent(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
902 void copyNeuronParameters(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
903 void copyGroupState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
904 void copyNeuronState(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
905 void copyNeuronStateBuffer(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
906 void copyNeuronSpikeCount(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
907 void copySynapseState(
int netId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
908 void copySTPState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
909 void copyWeightState(
int netId,
int lGrpId, cudaMemcpyKind kind);
910 void copyNetworkConfig(
int netId, cudaMemcpyKind kind);
911 void copyGroupConfigs(
int netId);
912 void copyGrpIdsLookupArray(
int netId, cudaMemcpyKind kind);
913 void copyConnIdsLookupArray(
int netId, cudaMemcpyKind kind);
914 void copyLastSpikeTime(
int netId, cudaMemcpyKind kind);
915 void copyNetworkSpikeCount(
int netId, cudaMemcpyKind kind,
916 unsigned int* spikeCountD1,
unsigned int* spikeCountD2,
917 unsigned int* spikeCountExtD1,
unsigned int* spikeCountExtD2);
918 void copySpikeTables(
int netId, cudaMemcpyKind kind);
919 void copyTimeTable(
int netId, cudaMemcpyKind kind);
920 void copyExtFiringTable(
int netId, cudaMemcpyKind kind);
922 #define cudaMemcpyKind int
923 #define cudaMemcpyHostToHost 0
924 #define cudaMemcpyHostToDevice 0
925 #define cudaMemcpyDeviceToHost 0
926 #define cudaMemcpyDeviceToDevice 0
927 #define cudaMemcpyDefault 0
929 void copyAuxiliaryData(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
930 void copyConductanceAMPA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
931 void copyConductanceNMDA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
932 void copyConductanceGABAa(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
933 void copyConductanceGABAb(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
934 void copyPreConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
935 void copyPostConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
936 void copyExternalCurrent(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
937 void copyNeuronParameters(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
938 void copyGroupState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
939 void copyNeuronState(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
940 void copyNeuronStateBuffer(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
941 void copyNeuronSpikeCount(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
942 void copySynapseState(
int netId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
943 void copySTPState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
944 void copyWeightState(
int netId,
int lGrpId, cudaMemcpyKind kind) { assert(
false); }
945 void copyNetworkConfig(
int netId, cudaMemcpyKind kind) { assert(
false); }
946 void copyGroupConfigs(
int netId) { assert(
false); }
947 void copyGrpIdsLookupArray(
int netId, cudaMemcpyKind kind) { assert(
false); }
948 void copyConnIdsLookupArray(
int netId, cudaMemcpyKind kind) { assert(
false); }
949 void copyLastSpikeTime(
int netId, cudaMemcpyKind kind) { assert(
false); }
950 void copyNetworkSpikeCount(
int netId, cudaMemcpyKind kind,
951 unsigned int* spikeCountD1,
unsigned int* spikeCountD2,
952 unsigned int* spikeCountExtD1,
unsigned int* spikeCountExtD2) { assert(
false); }
953 void copySpikeTables(
int netId, cudaMemcpyKind kind) { assert(
false); }
954 void copyTimeTable(
int netId, cudaMemcpyKind kind) { assert(
false); }
955 void copyExtFiringTable(
int netId, cudaMemcpyKind kind) { assert(
false); }
961 void allocateSNN_CPU(
int netId);
964 #if defined(WIN32) || defined(WIN64) || defined(__APPLE__)
965 void assignPoissonFiringRate_CPU(
int netId);
966 void clearExtFiringTable_CPU(
int netId);
967 void convertExtSpikesD2_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
968 void convertExtSpikesD1_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
969 void doCurrentUpdateD2_CPU(
int netId);
970 void doCurrentUpdateD1_CPU(
int netId);
971 void doSTPUpdateAndDecayCond_CPU(
int netId);
972 void deleteRuntimeData_CPU(
int netId);
973 void findFiring_CPU(
int netId);
974 void globalStateUpdate_CPU(
int netId);
975 void resetSpikeCnt_CPU(
int netId,
int lGrpId);
976 void shiftSpikeTables_CPU(
int netId);
977 void spikeGeneratorUpdate_CPU(
int netId);
978 void updateTimingTable_CPU(
int netId);
979 void updateWeights_CPU(
int netId);
980 #else // for APPLE and Win systems - returns a void* to pthread_create - only differ in the return type compared to the counterparts above
981 void* assignPoissonFiringRate_CPU(
int netId);
982 void* clearExtFiringTable_CPU(
int netId);
983 void* convertExtSpikesD2_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
984 void* convertExtSpikesD1_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
985 void* doCurrentUpdateD2_CPU(
int netId);
986 void* doCurrentUpdateD1_CPU(
int netId);
987 void* doSTPUpdateAndDecayCond_CPU(
int netId);
988 void* deleteRuntimeData_CPU(
int netId);
989 void* findFiring_CPU(
int netId);
990 void* globalStateUpdate_CPU(
int netId);
991 void* resetSpikeCnt_CPU(
int netId,
int lGrpId);
992 void* shiftSpikeTables_CPU(
int netId);
993 void* spikeGeneratorUpdate_CPU(
int netId);
994 void* updateTimingTable_CPU(
int netId);
995 void* updateWeights_CPU(
int netId);
998 static void* helperAssignPoissonFiringRate_CPU(
void*);
999 static void* helperClearExtFiringTable_CPU(
void*);
1000 static void* helperConvertExtSpikesD2_CPU(
void*);
1001 static void* helperConvertExtSpikesD1_CPU(
void*);
1002 static void* helperDoCurrentUpdateD2_CPU(
void*);
1003 static void* helperDoCurrentUpdateD1_CPU(
void*);
1004 static void* helperDoSTPUpdateAndDecayCond_CPU(
void*);
1005 static void* helperDeleteRuntimeData_CPU(
void*);
1006 static void* helperFindFiring_CPU(
void*);
1007 static void* helperGlobalStateUpdate_CPU(
void*);
1008 static void* helperResetSpikeCnt_CPU(
void*);
1009 static void* helperShiftSpikeTables_CPU(
void*);
1010 static void* helperSpikeGeneratorUpdate_CPU(
void*);
1011 static void* helperUpdateTimingTable_CPU(
void*);
1012 static void* helperUpdateWeights_CPU(
void*);
1016 void copyAuxiliaryData(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1017 void copyConductanceAMPA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1018 void copyConductanceNMDA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1019 void copyConductanceGABAa(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1020 void copyConductanceGABAb(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1021 void copyPreConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem);
1022 void copyPostConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem);
1023 void copyExternalCurrent(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1024 void copyNeuronParameters(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1026 void copyNeuronStateBuffer(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem);
1027 void copyNeuronState(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1028 void copyNeuronSpikeCount(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1031 void copyWeightState(
int netId,
int lGrpId);
1032 void copyNetworkConfig(
int netId);
1033 void copyGrpIdsLookupArray(
int netId);
1034 void copyConnIdsLookupArray(
int netId);
1035 void copyLastSpikeTime(
int netId);
1036 void copyNetworkSpikeCount(
int netId,
1037 unsigned int* spikeCountD1,
unsigned int* spikeCountD2,
1038 unsigned int* spikeCountExtD1,
unsigned int* spikeCountExtD2);
1039 void copySpikeTables(
int netId);
1040 void copyTimeTable(
int netId,
bool toManager);
1041 void copyExtFiringTable(
int netId);
1044 void firingUpdateSTP(
int lNId,
int lGrpId,
int netId);
1045 void updateLTP(
int lNId,
int lGrpId,
int netId);
1046 void resetFiredNeuron(
int lNId,
short int lGrpId,
int netId);
1047 bool getPoissonSpike(
int lNId,
int netId);
1048 bool getSpikeGenBit(
unsigned int nIdPos,
int netId);
1054 const std::string networkName_;
1056 const SimMode preferredSimMode_;
1057 const int randSeed_;
1062 int numAvailableGPUs;
1064 bool simulatorDeleted;
1065 bool spikeRateUpdated;
1068 bool sim_in_testing;
1072 int numCompartmentConnections;
1074 std::map<int, GroupConfig> groupConfigMap;
1075 std::map<int, GroupConfigMD> groupConfigMDMap;
1076 std::map<int, ConnectConfig> connectConfigMap;
1077 std::map<int, compConnectConfig> compConnectConfigMap;
1087 std::list<RoutingTableEntry> spikeRoutingTable;
1095 bool sim_with_conductances;
1096 bool sim_with_NMDA_rise;
1097 bool sim_with_GABAb_rise;
1107 bool sim_with_compartments;
1108 bool sim_with_fixedwts;
1110 bool sim_with_modulated_stdp;
1111 bool sim_with_homeostasis;
1113 bool sim_with_spikecounters;
1118 int simTimeRunStart;
1120 int simTimeLastRunSummary;
1127 StopWatchInterface* timer;
1129 float cumExecutionTime;
1130 float lastExecutionTime;
1131 float prevExecutionTime;
1132 float executionTime;
1140 int numSpikeMonitor;
1145 int numNeuronMonitor;
1150 long int simTimeLastUpdSpkMon_;
1152 int numSpikeGenGrps;
1155 int numGroupMonitor;
1164 int numConnectionMonitor;
1171 typedef struct ManagerRuntimeDataSize_s {
1172 unsigned int maxMaxSpikeD1;
1173 unsigned int maxMaxSpikeD2;
1176 int maxNumNSpikeGen;
1177 int maxNumNAssigned;
1179 int maxNumConnections;
1180 int maxNumPostSynNet;
1181 int maxNumPreSynNet;
1182 int maxNumNPerGroup;
1185 } ManagerRuntimeDataSize;
1187 ManagerRuntimeDataSize managerRTDSize;
1195 int wtANDwtChangeUpdateInterval_;
1196 int wtANDwtChangeUpdateIntervalCnt_;
1197 float stdpScaleFactor_;
1198 float wtChangeDecay_;
int getNumNeuronsRegInh()
NeuronMonitor * getNeuronMonitor(int grpId)
Returns pointer to existing NeuronMonitor object, NULL else.
int getGroupNumNeurons(int gGrpId)
GroupMonitor * setGroupMonitor(int grpId, FILE *fid)
sets up a group monitor registered with a callback to process the spikes.
int getGroupStartNeuronId(int gGrpId)
void setConductances(bool isSet, int tdAMPA, int trNMDA, int tdNMDA, int tdGABAa, int trGABAb, int tdGABAb)
Sets custom values for conductance decay (\tau_decay) or disables conductances alltogether These will...
std::string getNetworkName()
integrationMethod_t
Integration methods.
The runtime configuration of a group.
void loadSimulation(FILE *fid)
void setNeuronParametersLIF(int grpId, int tau_m, int tau_ref, float vTh, float vReset, double minRmem, double maxRmem)
Sets neuron parameters for a group of LIF spiking neurons.
void biasWeights(short int connId, float bias, bool updateWeightRange=false)
a range struct for synaptic weight magnitudes
short int connect(int gIDpre, int gIDpost, const std::string &_type, float initWt, float maxWt, float prob, uint8_t minDelay, uint8_t maxDelay, RadiusRF radius, float mulSynFast, float mulSynSlow, bool synWtType)
make from each neuron in grpId1 to 'numPostSynapses' neurons in grpId2
bool isSimulationWithGABAbRise()
int getNumNeuronsRegExc()
void saveSimulation(FILE *fid, bool saveSynapseInfo=false)
stores the pre and post synaptic neuron ids with the weight and delay
float * getCurrent()
temporary getter to return pointer to current[]
int getNumNeuronsGenExc()
std::vector< float > getConductanceGABAa(int grpId)
GroupSTDPInfo getGroupSTDPInfo(int grpId)
void setSpikeGenerator(int grpId, SpikeGeneratorCore *spikeGenFunc)
sets up a spike generator
bool isPoint3DinRF(const RadiusRF &radius, const Point3D &pre, const Point3D &post)
int runNetwork(int _nsec, int _nmsec, bool printRunSummary)
run the simulation for n sec
void setWeightAndWeightChangeUpdate(UpdateInterval wtANDwtChangeUpdateInterval, bool enableWtChangeDecay, float wtChangeDecay)
Sets the weight and weight change update parameters.
NeuronMonitorCore * getNeuronMonitorCore(int grpId)
used for relaying callback to SpikeGenerator
void updateGroupMonitor(int grpId=ALL)
access group status (currently the concentration of neuromodulator)
SpikeMonitorCore * getSpikeMonitorCore(int grpId)
bool isConnectionPlastic(short int connId)
returns whether synapses in connection are fixed (false) or plastic (true)
double getRFDist3D(const RadiusRF &radius, const Point3D &pre, const Point3D &post)
checks whether a point pre lies in the receptive field for point post
void setExternalCurrent(int grpId, const std::vector< float > ¤t)
injects current (mA) into the soma of every neuron in the group
void setLogsFp(FILE *fpInf=NULL, FILE *fpErr=NULL, FILE *fpDeb=NULL, FILE *fpLog=NULL)
Sets the file pointers for all log files file pointer NULL means don't change it.
runtime network configuration
bool isSimulationWithHomeostasis()
A struct for retrieving STDP related information of a group.
ConnectConfig getConnectConfig(short int connectId)
required for homeostasis
used for relaying callback to ConnectionGenerator
Class for generating Poisson spike trains.
int numSynNet
number of total synaptic connections in the global network
std::vector< float > getConductanceNMDA(int grpId)
void setCompartmentParameters(int grpId, float couplingUp, float couplingDown)
Coupling constants for the compartment are set using this method.
void startTesting(bool shallUpdateWeights=true)
enters a testing phase, where all weight updates are disabled
The runtime configuration of a connection.
int getNumNeuronsGenInh()
bool isSimulationWithSTP()
void setNeuromodulator(int grpId, float baseDP, float tauDP, float base5HT, float tau5HT, float baseACh, float tauACh, float baseNE, float tauNE)
Sets baseline concentration and decay time constant of neuromodulators (DP, 5HT, ACh,...
void updateConnectionMonitor(short int connId=ALL)
polls connection weights
GroupMonitor private core implementation.
SpikeMonitor * setSpikeMonitor(int gid, FILE *fid)
sets up a spike monitor registered with a callback to process the spikes, there can only be one Spike...
float * getSTPx()
temporary getter to return pointer to stpx[]
bool isSimulationWithPlasticWeights()
void updateNeuronMonitor(int grpId=ALL)
copy required neuron state values from ??? buffer to ??? buffer
static const unsigned int MINOR_VERSION
minor release version, as in CARLsim 2.X
int getNumCompartmentConnections()
int createGroup(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
Creates a group of Izhikevich spiking neurons.
int numNPois
number of poisson neurons in the global network
GroupNeuromodulatorInfo getGroupNeuromodulatorInfo(int grpId)
a range struct for synaptic delays
int getGroupEndNeuronId(int gGrpId)
bool isSimulationWithCUBA()
void setupNetwork()
build the network
void stopTesting()
exits a testing phase, making weight updates possible again
static const unsigned int MAJOR_VERSION
major release version, as in CARLsim X
int numNExcPois
number of excitatory poisson neurons in the global network
NeuronMonitor * setNeuronMonitor(int gid, FILE *fid)
sets up a neuron monitor registered with a callback to process the neuron state values,...
bool isPoissonGroup(int gGrpId)
#define ALL
CARLsim common definitions.
std::vector< std::vector< float > > getWeightMatrix2D(short int connId)
int getGroupId(std::string grpName)
ComputingBackend
computing backend
SpikeMonitor * getSpikeMonitor(int grpId)
Returns pointer to existing SpikeMonitor object, NULL else.
int createSpikeGeneratorGroup(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
Creates a spike generator group (dummy-neurons, not Izhikevich spiking neurons)
bool isSimulationWithNMDARise()
bool isSimulationWithCompartments()
std::vector< float > getConductanceAMPA(int grpId)
SNN(const std::string &name, SimMode preferredSimMode, LoggerMode loggerMode, int randSeed)
SNN Constructor.
void setWeight(short int connId, int neurIdPre, int neurIdPost, float weight, bool updateWeightRange=false)
sets the weight value of a specific synapse
float * getSTPu()
temporary getter to return pointer to stpu[]
Point3D getNeuronLocation3D(int neurId)
void setIntegrationMethod(integrationMethod_t method, int numStepsPerMs)
Sets the integration method and the number of integration steps per 1ms simulation time step.
void scaleWeights(short int connId, float scale, bool updateWeightRange=false)
const FILE * getLogFpErr()
returns file pointer to error log
bool isSimulationWithFixedWeightsOnly()
int numNInhPois
number of inhibitory poisson neurons in the global network
const FILE * getLogFpInf()
function writes population weights from gIDpre to gIDpost to file fname in binary.
A struct to arrange neurons on a 3D grid (a primitive cubic Bravais lattice with cubic side length 1)
short int connectCompartments(int grpIdLower, int grpIdUpper)
void setHomeostasis(int grpId, bool isSet, float homeoScale, float avgTimeScale)
Sets the homeostasis parameters. g is the grpID, enable=true(false) enables(disables) homeostasis,...
void setSpikeRate(int grpId, PoissonRate *spikeRate, int refPeriod)
Sets the Poisson spike rate for a group. For information on how to set up spikeRate,...
void setESTDP(int grpId, bool isSet, STDPType type, STDPCurve curve, float alphaPlus, float tauPlus, float alphaMinus, float tauMinus, float gamma)
Set the spike-timing-dependent plasticity (STDP) for a neuron group.
int numNExcReg
number of regular excitatory neurons in the global network
The configuration of a connection.
Circular buffer for delivering spikes.
int getNumSynapticConnections(short int connectionId)
gets number of connections associated with a connection ID
int numN
number of neurons in the global network
bool isSimulationWithCOBA()
const FILE * getLogFpDeb()
returns file pointer to debug log
void setNeuronParameters(int grpId, float izh_a, float izh_a_sd, float izh_b, float izh_b_sd, float izh_c, float izh_c_sd, float izh_d, float izh_d_sd)
Sets the Izhikevich parameters a, b, c, and d of a neuron group.
int createGroupLIF(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
Creates a group of LIF spiking neurons.
void setHomeoBaseFiringRate(int groupId, float baseFiring, float baseFiringSD)
Sets homeostatic target firing rate (enforced through homeostatic synaptic scaling)
bool isInhibitoryGroup(int gGrpId)
std::string getGroupName(int grpId)
bool isGroupWithHomeostasis(int grpId)
returns whether group has homeostasis enabled (true) or not (false)
int numNInhReg
number of regular inhibitory neurons in the global network
void exitSimulation(int val=1)
deallocates all dynamical structures and exits
bool isSimulationWithSTDP()
int numNReg
number of regular (spking) neurons in the global network
Contains all of CARLsim's core functionality.
std::vector< float > getConductanceGABAb(int grpId)
RangeWeight getWeightRange(short int connId)
returns RangeWeight struct of a connection
A struct for retrieving neuromodulator information of a group.
LoggerMode getLoggerMode()
UpdateInterval
Update frequency for weights.
bool isExcitatoryGroup(int gGrpId)
uint8_t * getDelays(int gGrpIdPre, int gGrpIdPost, int &numPreN, int &numPostN)
Returns the delay information for all synaptic connections between a pre-synaptic and a post-synaptic...
void setISTDP(int grpId, bool isSet, STDPType type, STDPCurve curve, float ab1, float ab2, float tau1, float tau2)
Set the inhibitory spike-timing-dependent plasticity (STDP) with anti-hebbian curve for a neuron grou...
ConnectionMonitor * setConnectionMonitor(int grpIdPre, int grpIdPost, FILE *fid)
sets up a network monitor registered with a callback to process the spikes.
short int getConnectId(int grpIdPre, int grpIdPost)
find connection ID based on pre-post group pair, O(N)
bool isDopaminergicGroup(int gGrpId)
Grid3D getGroupGrid3D(int grpId)
void setSTP(int grpId, bool isSet, float STP_U, float STP_tau_u, float STP_tau_x)
Sets STP params U, tau_u, and tau_x of a neuron group (pre-synaptically) CARLsim implements the short...
A struct to specify the receptive field (RF) radius in 3 dimensions.
RangeDelay getDelayRange(short int connId)
returns the RangeDelay struct of a connection
void updateSpikeMonitor(int grpId=ALL)
copy required spikes from firing buffer to spike buffer
const FILE * getLogFpLog()
returns file pointer to log file
SNNState
the state of spiking neural network, used with in kernel.