CARLsim
5.0.0
CARLsim: a GPU-accelerated SNN simulator
|
Go to the documentation of this file.
164 short int connect(
int gIDpre,
int gIDpost,
const std::string& _type,
float initWt,
float maxWt,
float prob,
165 uint8_t minDelay, uint8_t maxDelay,
RadiusRF radius,
166 float mulSynFast,
float mulSynSlow,
bool synWtType);
231 void setConductances(
bool isSet,
int tdAMPA,
int trNMDA,
int tdNMDA,
int tdGABAa,
int trGABAb,
int tdGABAb);
240 void setHomeostasis(
int grpId,
bool isSet,
float homeoScale,
float avgTimeScale);
261 void setNeuronParameters(
int grpId,
float izh_a,
float izh_a_sd,
float izh_b,
float izh_b_sd,
262 float izh_c,
float izh_c_sd,
float izh_d,
float izh_d_sd);
276 void setNeuronParametersLIF(
int grpId,
int tau_m,
int tau_ref,
float vTh,
float vReset,
double minRmem,
double maxRmem);
302 void setNeuronParameters(
int grpId,
float izh_C,
float izh_C_sd,
float izh_k,
float izh_k_sd,
303 float izh_vr,
float izh_vr_sd,
float izh_vt,
float izh_vt_sd,
304 float izh_a,
float izh_a_sd,
float izh_b,
float izh_b_sd,
305 float izh_vpeak,
float izh_vpeak_sd,
float izh_c,
float izh_c_sd,
306 float izh_d,
float izh_d_sd);
320 void setNeuromodulator(
int grpId,
float baseDP,
float tauDP,
float base5HT,
float tau5HT,
321 float baseACh,
float tauACh,
float baseNE,
float tauNE);
335 void setESTDP(
int grpId,
bool isSet,
STDPType type,
STDPCurve curve,
float alphaPlus,
float tauPlus,
float alphaMinus,
float tauMinus,
float gamma);
372 void setSTP(
int grpId,
bool isSet,
float STP_U,
float STP_tau_u,
float STP_tau_x);
389 int runNetwork(
int _nsec,
int _nmsec,
bool printRunSummary);
400 void biasWeights(
short int connId,
float bias,
bool updateWeightRange =
false);
415 void scaleWeights(
short int connId,
float scale,
bool updateWeightRange =
false);
463 void setWeight(
short int connId,
int neurIdPre,
int neurIdPost,
float weight,
bool updateWeightRange =
false);
526 void setLogsFp(FILE* fpInf = NULL, FILE* fpErr = NULL, FILE* fpDeb = NULL, FILE* fpLog = NULL);
546 uint8_t*
getDelays(
int gGrpIdPre,
int gGrpIdPost,
int& numPreN,
int& numPostN);
656 void allocateManagerRuntimeData();
658 int assignGroup(
int gGrpId,
int availableNeuronId);
659 int assignGroup(std::list<GroupConfigMD>::iterator grpIt,
int localGroupId,
int availableNeuronId);
660 void generateGroupRuntime(
int netId,
int lGrpId);
661 void generatePoissonGroupRuntime(
int netId,
int lGrpId);
662 void generateConnectionRuntime(
int netId);
663 void generateCompConnectionRuntime(
int netId);
668 void generateRuntimeNetworkConfigs();
669 void generateRuntimeGroupConfigs();
670 void generateRuntimeConnectConfigs();
675 void collectGlobalNetworkConfigC();
676 void compileConnectConfig();
677 void compileGroupConfig();
679 void collectGlobalNetworkConfigP();
684 void connectNetwork();
685 inline void connectNeurons(
int netId,
int srcGrp,
int destGrp,
int srcN,
int destN,
short int connId,
int externalNetId);
686 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);
687 void connectFull(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
688 void connectOneToOne(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
689 void connectRandom(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
690 void connectGaussian(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
691 void connectUserDefined(
int netId, std::list<ConnectConfig>::iterator connIt,
bool isExternal);
693 void deleteObjects();
695 void findMaxNumSynapsesGroups(
int* _maxNumPostSynGrp,
int* _maxNumPreSynGrp);
696 void findMaxNumSynapsesNeurons(
int _netId,
int& _maxNumPostSynN,
int& _maxNumPreSynN);
697 void findMaxSpikesD1D2(
int netId,
unsigned int& _maxSpikesD1,
unsigned int& _maxSpikesD2);
698 void findNumSynapsesNetwork(
int netId,
int& _numPostSynNet,
int& _numPreSynNet);
699 void findNumN(
int _netId,
int& _numN,
int& _nunNExternal,
int& numNAssigned,
700 int& _numNReg,
int& _numNExcReg,
int& _numNInhReg,
701 int& _numNPois,
int& _numNExcPois,
int& _numNInhPois);
702 void findNumNSpikeGenAndOffset(
int _netId);
704 void generatePostSynapticSpike(
int preNId,
int postNId,
int synId,
int tD,
int netId);
705 void fillSpikeGenBits(
int netId);
706 void userDefinedSpikeGenerator(
int gGrpId);
708 float generateWeight(
int connProp,
float initWt,
float maxWt,
int nid,
int grpId);
711 void verifyNetwork();
717 void verifyHomeostasis();
720 void verifyCompartments();
729 void generateRuntimeSNN();
751 void printConnectionInfo(
short int connId);
752 void printConnectionInfo(
int netId, std::list<ConnectConfig>::iterator connIt);
753 void printGroupInfo(
int grpId);
754 void printGroupInfo(
int netId, std::list<GroupConfigMD>::iterator grpIt);
755 void printSimSummary();
756 void printStatusConnectionMonitor(
int connId =
ALL);
757 void printStatusGroupMonitor(
int gGrpId =
ALL);
758 void printStatusSpikeMonitor(
int gGrpId =
ALL);
759 void printSikeRoutingInfo();
761 int loadSimulation_internal(
bool onlyPlastic);
763 void resetConductances(
int netId);
764 void resetCurrent(
int netId);
765 void resetFiringInformation();
766 void resetGroupConfigs(
bool deallocate =
false);
767 void resetNeuromodulator(
int netId,
int lGrpId);
768 void resetNeuron(
int netId,
int lGrpId,
int lNId);
769 void resetMonitors(
bool deallocate =
false);
770 void resetConnectionConfigs(
bool deallocate =
false);
771 void deleteManagerRuntimeData();
772 void resetPoissonNeuron(
int netId,
int lGrpId,
int lNId);
773 void resetPropogationBuffer();
774 void resetSynapse(
int netId,
bool changeWeights =
false);
775 void resetTimeTable();
776 void resetFiringTable();
778 void transferSpikes(
void* dest,
int destNetId,
void* src,
int srcNetId,
int size);
781 inline SynInfo SET_CONN_ID(
int nid,
int sid,
int grpId);
783 void setGrpTimeSlice(
int grpId,
int timeSlice);
784 int setRandSeed(
int seed);
789 void generateUserDefinedSpikes();
791 void allocateManagerSpikeTables();
795 float getCompCurrent(
int netid,
int lGrpId,
int lneurId,
float const0 = 0.0f,
float const1 = 0.0f);
798 void allocateSNN(
int netId);
799 void clearExtFiringTable();
800 void convertExtSpikesD1(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
801 void convertExtSpikesD2(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
802 void doCurrentUpdate();
803 void doSTPUpdateAndDecayCond();
804 void deleteRuntimeData();
806 void globalStateUpdate();
807 void resetSpikeCnt(
int gGrpId);
808 void shiftSpikeTables();
809 void spikeGeneratorUpdate();
810 void updateTimingTable();
811 void updateWeights();
812 void updateNetworkConfig(
int netId);
815 void fetchConductanceAMPA(
int gGrpId);
816 void fetchConductanceNMDA(
int gGrpId);
817 void fetchConductanceGABAa(
int gGrpId);
818 void fetchConductanceGABAb(
int gGrpId);
819 void fetchNetworkSpikeCount();
820 void fetchNeuronSpikeCount(
int gGrpId);
821 void fetchSTPState(
int gGrpId);
824 void fetchSpikeTables(
int netId);
825 void fetchNeuronStateBuffer(
int netId,
int lGrpId);
826 void fetchGroupState(
int netId,
int lGrpId);
827 void fetchWeightState(
int netId,
int lGrpId);
828 void fetchGrpIdsLookupArray(
int netId);
829 void fetchConnIdsLookupArray(
int netId);
830 void fetchLastSpikeTime(
int netId);
831 void fetchPreConnectionInfo(
int netId);
832 void fetchPostConnectionInfo(
int netId);
833 void fetchSynapseState(
int netId);
834 void fetchExtFiringTable(
int netId);
835 void fetchTimeTable(
int netId);
836 void writeBackTimeTable(
int netId);
840 void allocateSNN_GPU(
int netId);
841 void assignPoissonFiringRate_GPU(
int netId);
842 void clearExtFiringTable_GPU(
int netId);
843 void convertExtSpikesD1_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
844 void convertExtSpikesD2_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
845 void doCurrentUpdateD1_GPU(
int netId);
846 void doCurrentUpdateD2_GPU(
int netId);
847 void doSTPUpdateAndDecayCond_GPU(
int netId);
848 void deleteRuntimeData_GPU(
int netId);
849 void findFiring_GPU(
int netId);
850 void globalStateUpdate_C_GPU(
int netId);
851 void globalStateUpdate_N_GPU(
int netId);
852 void globalStateUpdate_G_GPU(
int netId);
853 void resetSpikeCnt_GPU(
int netId,
int lGrpId);
854 void shiftSpikeTables_F_GPU(
int netId);
855 void shiftSpikeTables_T_GPU(
int netId);
856 void spikeGeneratorUpdate_GPU(
int netId);
857 void updateTimingTable_GPU(
int netId);
858 void updateWeights_GPU(
int netId);
860 void allocateSNN_GPU(
int netId) { assert(
false); }
861 void assignPoissonFiringRate_GPU(
int netId) { assert(
false); }
862 void clearExtFiringTable_GPU(
int netId) { assert(
false); }
863 void convertExtSpikesD1_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset) { assert(
false); }
864 void convertExtSpikesD2_GPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset) { assert(
false); }
865 void doCurrentUpdateD1_GPU(
int netId) { assert(
false); }
866 void doCurrentUpdateD2_GPU(
int netId) { assert(
false); }
867 void doSTPUpdateAndDecayCond_GPU(
int netId) { assert(
false); }
868 void deleteRuntimeData_GPU(
int netId) { assert(
false); }
869 void findFiring_GPU(
int netId) { assert(
false); }
870 void globalStateUpdate_C_GPU(
int netId) { assert(
false); }
871 void globalStateUpdate_N_GPU(
int netId) { assert(
false); }
872 void globalStateUpdate_G_GPU(
int netId) { assert(
false); }
873 void resetSpikeCnt_GPU(
int netId,
int lGrpId) { assert(
false); }
874 void shiftSpikeTables_F_GPU(
int netId) { assert(
false); }
875 void shiftSpikeTables_T_GPU(
int netId) { assert(
false); }
876 void spikeGeneratorUpdate_GPU(
int netId) { assert(
false); }
877 void updateTimingTable_GPU(
int netId) { assert(
false); }
878 void updateWeights_GPU(
int netId) { assert(
false); }
883 void allocateGroupId(
int netId);
884 int allocateStaticLoad(
int netId,
int bufSize);
885 void checkAndSetGPUDevice(
int netId);
886 void checkDestSrcPtrs(
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int grpId,
int destOffset);
887 int configGPUDevice();
888 void initGPU(
int netId);
890 int configGPUDevice() {
return 0; }
895 void copyAuxiliaryData(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
896 void copyConductanceAMPA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
897 void copyConductanceNMDA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
898 void copyConductanceGABAa(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
899 void copyConductanceGABAb(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
900 void copyPreConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
901 void copyPostConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
902 void copyExternalCurrent(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
903 void copyNeuronParameters(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
904 void copyGroupState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
905 void copyNeuronState(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem);
906 void copyNeuronStateBuffer(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
907 void copyNeuronSpikeCount(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset);
908 void copySynapseState(
int netId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
909 void copySTPState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem);
910 void copyWeightState(
int netId,
int lGrpId, cudaMemcpyKind kind);
911 void copyNetworkConfig(
int netId, cudaMemcpyKind kind);
912 void copyGroupConfigs(
int netId);
913 void copyGrpIdsLookupArray(
int netId, cudaMemcpyKind kind);
914 void copyConnIdsLookupArray(
int netId, cudaMemcpyKind kind);
915 void copyLastSpikeTime(
int netId, cudaMemcpyKind kind);
916 void copyNetworkSpikeCount(
int netId, cudaMemcpyKind kind,
917 unsigned int* spikeCountD1,
unsigned int* spikeCountD2,
918 unsigned int* spikeCountExtD1,
unsigned int* spikeCountExtD2);
919 void copySpikeTables(
int netId, cudaMemcpyKind kind);
920 void copyTimeTable(
int netId, cudaMemcpyKind kind);
921 void copyExtFiringTable(
int netId, cudaMemcpyKind kind);
923 #define cudaMemcpyKind int
924 #define cudaMemcpyHostToHost 0
925 #define cudaMemcpyHostToDevice 0
926 #define cudaMemcpyDeviceToHost 0
927 #define cudaMemcpyDeviceToDevice 0
928 #define cudaMemcpyDefault 0
930 void copyAuxiliaryData(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
931 void copyConductanceAMPA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
932 void copyConductanceNMDA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
933 void copyConductanceGABAa(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
934 void copyConductanceGABAb(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
935 void copyPreConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
936 void copyPostConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
937 void copyExternalCurrent(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
938 void copyNeuronParameters(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
939 void copyGroupState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
940 void copyNeuronState(
int netId,
int lGrpId,
RuntimeData* dest, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
941 void copyNeuronStateBuffer(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
942 void copyNeuronSpikeCount(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem,
int destOffset) { assert(
false); }
943 void copySynapseState(
int netId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
944 void copySTPState(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src, cudaMemcpyKind kind,
bool allocateMem) { assert(
false); }
945 void copyWeightState(
int netId,
int lGrpId, cudaMemcpyKind kind) { assert(
false); }
946 void copyNetworkConfig(
int netId, cudaMemcpyKind kind) { assert(
false); }
947 void copyGroupConfigs(
int netId) { assert(
false); }
948 void copyGrpIdsLookupArray(
int netId, cudaMemcpyKind kind) { assert(
false); }
949 void copyConnIdsLookupArray(
int netId, cudaMemcpyKind kind) { assert(
false); }
950 void copyLastSpikeTime(
int netId, cudaMemcpyKind kind) { assert(
false); }
951 void copyNetworkSpikeCount(
int netId, cudaMemcpyKind kind,
952 unsigned int* spikeCountD1,
unsigned int* spikeCountD2,
953 unsigned int* spikeCountExtD1,
unsigned int* spikeCountExtD2) { assert(
false); }
954 void copySpikeTables(
int netId, cudaMemcpyKind kind) { assert(
false); }
955 void copyTimeTable(
int netId, cudaMemcpyKind kind) { assert(
false); }
956 void copyExtFiringTable(
int netId, cudaMemcpyKind kind) { assert(
false); }
962 void allocateSNN_CPU(
int netId);
965 #if defined(WIN32) || defined(WIN64) || defined(__APPLE__)
966 void assignPoissonFiringRate_CPU(
int netId);
967 void clearExtFiringTable_CPU(
int netId);
968 void convertExtSpikesD2_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
969 void convertExtSpikesD1_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
970 void doCurrentUpdateD2_CPU(
int netId);
971 void doCurrentUpdateD1_CPU(
int netId);
972 void doSTPUpdateAndDecayCond_CPU(
int netId);
973 void deleteRuntimeData_CPU(
int netId);
974 void findFiring_CPU(
int netId);
975 void globalStateUpdate_CPU(
int netId);
976 void resetSpikeCnt_CPU(
int netId,
int lGrpId);
977 void shiftSpikeTables_CPU(
int netId);
978 void spikeGeneratorUpdate_CPU(
int netId);
979 void updateTimingTable_CPU(
int netId);
980 void updateWeights_CPU(
int netId);
981 #else // for APPLE and Win systems - returns a void* to pthread_create - only differ in the return type compared to the counterparts above
982 void* assignPoissonFiringRate_CPU(
int netId);
983 void* clearExtFiringTable_CPU(
int netId);
984 void* convertExtSpikesD2_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
985 void* convertExtSpikesD1_CPU(
int netId,
int startIdx,
int endIdx,
int GtoLOffset);
986 void* doCurrentUpdateD2_CPU(
int netId);
987 void* doCurrentUpdateD1_CPU(
int netId);
988 void* doSTPUpdateAndDecayCond_CPU(
int netId);
989 void* deleteRuntimeData_CPU(
int netId);
990 void* findFiring_CPU(
int netId);
991 void* globalStateUpdate_CPU(
int netId);
992 void* resetSpikeCnt_CPU(
int netId,
int lGrpId);
993 void* shiftSpikeTables_CPU(
int netId);
994 void* spikeGeneratorUpdate_CPU(
int netId);
995 void* updateTimingTable_CPU(
int netId);
996 void* updateWeights_CPU(
int netId);
999 static void* helperAssignPoissonFiringRate_CPU(
void*);
1000 static void* helperClearExtFiringTable_CPU(
void*);
1001 static void* helperConvertExtSpikesD2_CPU(
void*);
1002 static void* helperConvertExtSpikesD1_CPU(
void*);
1003 static void* helperDoCurrentUpdateD2_CPU(
void*);
1004 static void* helperDoCurrentUpdateD1_CPU(
void*);
1005 static void* helperDoSTPUpdateAndDecayCond_CPU(
void*);
1006 static void* helperDeleteRuntimeData_CPU(
void*);
1007 static void* helperFindFiring_CPU(
void*);
1008 static void* helperGlobalStateUpdate_CPU(
void*);
1009 static void* helperResetSpikeCnt_CPU(
void*);
1010 static void* helperShiftSpikeTables_CPU(
void*);
1011 static void* helperSpikeGeneratorUpdate_CPU(
void*);
1012 static void* helperUpdateTimingTable_CPU(
void*);
1013 static void* helperUpdateWeights_CPU(
void*);
1017 void copyAuxiliaryData(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1018 void copyConductanceAMPA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1019 void copyConductanceNMDA(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1020 void copyConductanceGABAa(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1021 void copyConductanceGABAb(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1022 void copyPreConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem);
1023 void copyPostConnectionInfo(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem);
1024 void copyExternalCurrent(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1025 void copyNeuronParameters(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1027 void copyNeuronStateBuffer(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem);
1028 void copyNeuronState(
int netId,
int lGrpId,
RuntimeData* dest,
bool allocateMem);
1029 void copyNeuronSpikeCount(
int netId,
int lGrpId,
RuntimeData* dest,
RuntimeData* src,
bool allocateMem,
int destOffset);
1032 void copyWeightState(
int netId,
int lGrpId);
1033 void copyNetworkConfig(
int netId);
1034 void copyGrpIdsLookupArray(
int netId);
1035 void copyConnIdsLookupArray(
int netId);
1036 void copyLastSpikeTime(
int netId);
1037 void copyNetworkSpikeCount(
int netId,
1038 unsigned int* spikeCountD1,
unsigned int* spikeCountD2,
1039 unsigned int* spikeCountExtD1,
unsigned int* spikeCountExtD2);
1040 void copySpikeTables(
int netId);
1041 void copyTimeTable(
int netId,
bool toManager);
1042 void copyExtFiringTable(
int netId);
1045 void firingUpdateSTP(
int lNId,
int lGrpId,
int netId);
1046 void updateLTP(
int lNId,
int lGrpId,
int netId);
1047 void resetFiredNeuron(
int lNId,
short int lGrpId,
int netId);
1048 bool getPoissonSpike(
int lNId,
int netId);
1049 bool getSpikeGenBit(
unsigned int nIdPos,
int netId);
1055 const std::string networkName_;
1057 const SimMode preferredSimMode_;
1058 const int randSeed_;
1063 int numAvailableGPUs;
1065 bool simulatorDeleted;
1066 bool spikeRateUpdated;
1069 bool sim_in_testing;
1073 int numCompartmentConnections;
1075 std::map<int, GroupConfig> groupConfigMap;
1076 std::map<int, GroupConfigMD> groupConfigMDMap;
1077 std::map<int, ConnectConfig> connectConfigMap;
1078 std::map<int, compConnectConfig> compConnectConfigMap;
1088 std::list<RoutingTableEntry> spikeRoutingTable;
1096 bool sim_with_conductances;
1097 bool sim_with_NMDA_rise;
1098 bool sim_with_GABAb_rise;
1108 bool sim_with_compartments;
1109 bool sim_with_fixedwts;
1111 bool sim_with_modulated_stdp;
1112 bool sim_with_homeostasis;
1114 bool sim_with_spikecounters;
1119 int simTimeRunStart;
1121 int simTimeLastRunSummary;
1128 StopWatchInterface* timer;
1130 float cumExecutionTime;
1131 float lastExecutionTime;
1132 float prevExecutionTime;
1133 float executionTime;
1141 int numSpikeMonitor;
1146 int numNeuronMonitor;
1151 long int simTimeLastUpdSpkMon_;
1153 int numSpikeGenGrps;
1156 int numGroupMonitor;
1165 int numConnectionMonitor;
1172 typedef struct ManagerRuntimeDataSize_s {
1173 unsigned int maxMaxSpikeD1;
1174 unsigned int maxMaxSpikeD2;
1177 int maxNumNSpikeGen;
1178 int maxNumNAssigned;
1180 int maxNumConnections;
1181 int maxNumPostSynNet;
1182 int maxNumPreSynNet;
1183 int maxNumNPerGroup;
1186 } ManagerRuntimeDataSize;
1188 ManagerRuntimeDataSize managerRTDSize;
1196 int wtANDwtChangeUpdateInterval_;
1197 int wtANDwtChangeUpdateIntervalCnt_;
1198 float stdpScaleFactor_;
1199 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.