![]() |
GeNN
1.1
GPU enhanced Neuronal Networks (GeNN)
|
Contains functions to generate code for running the simulation on the GPU, and for I/O convenience functions between GPU and CPU space. Part of the code generation section. More...
Functions | |
void | genRunner (NNmodel &model, string path, ostream &mos) |
A function that generates predominantly host-side code. More... | |
void | genRunnerGPU (NNmodel &model, string &path, ostream &mos) |
A function to generate the code that simulates the model on the GPU. More... | |
void | genRunnerCPU (NNmodel &model, string &path, ostream &mos) |
A function to generate code for an equivalent CPU-only simulation engine. More... | |
Contains functions to generate code for running the simulation on the GPU, and for I/O convenience functions between GPU and CPU space. Part of the code generation section.
void genRunner | ( | NNmodel & | model, |
string | path, | ||
ostream & | mos | ||
) |
A function that generates predominantly host-side code.
In this function host-side functions and other code are generated, including: Global host variables, "allocatedMem()" function for allocating memories, "freeMem" function for freeing the allocated memories, "initialize" for initializing host variables, "gFunc" and "initGRaw()" for use with plastic synapses if such synapses exist in the model.
model | Model description |
path | path for code generation |
mos | output stream for messages |
void genRunnerCPU | ( | NNmodel & | model, |
string & | path, | ||
ostream & | mos | ||
) |
A function to generate code for an equivalent CPU-only simulation engine.
The generated code provides the same functionality as the code generated for the GPU but only utilizing the CPU. That being so, no convenience functions for data transfer are necessary in this scenario and the only generated function is "stepTimeCPU()" for simulating a time step of the model on the CPU (using the CPU functions for simuations, equivalent to the kernels in the GPU case, that are generated by generateNeuronFunction() and generateSynapseFunction().
model | Neuronal network model description |
path | Path for code generation |
mos | Output stream for messages |
void genRunnerGPU | ( | NNmodel & | model, |
string & | path, | ||
ostream & | mos | ||
) |
A function to generate the code that simulates the model on the GPU.
The function generates functions that will spawn kernel grids onto the GPU (but not the actual kernel code which is generated in "genNeuronKernel()" and "genSynpaseKernel()"). Generated functions include "copyGToDevice()", "copyGFromDevice()", "copyStateToDevice()", "copyStateFromDevice()", "copySpikesFromDevice()", "copySpikeNFromDevice()" and "stepTimeGPU()". The last mentioned function is the function that will initialize the execution on the GPU in the generated simulation engine. All other generated functions are "convenience functions" to handle data transfer from and to the GPU.
model | Model description |
path | path for code generation |
mos | output stream for messages |