![]() |
GeNN
2.2.3
GPU enhanced Neuronal Networks (GeNN)
|
Contains functions that generate code for CUDA kernels. Part of the code generation section. More...
#include "generateKernels.h"
#include "global.h"
#include "utils.h"
#include "stringUtils.h"
#include "CodeHelper.h"
#include <algorithm>
Functions | |
void | genNeuronKernel (const NNmodel &model, const string &path) |
Function for generating the CUDA kernel that simulates all neurons in the model. More... | |
void | generate_process_presynaptic_events_code (ostream &os, const NNmodel &model, unsigned int src, unsigned int trg, int i, const string &localID, unsigned int inSynNo, const string &postfix) |
Function for generating the CUDA synapse kernel code that handles presynaptic spikes or spike type events. More... | |
void | genSynapseKernel (const NNmodel &model, const string &path) |
Function for generating a CUDA kernel for simulating all synapses. More... | |
Variables | |
short * | isGrpVarNeeded |
Contains functions that generate code for CUDA kernels. Part of the code generation section.
void generate_process_presynaptic_events_code | ( | ostream & | os, |
const NNmodel & | model, | ||
unsigned int | src, | ||
unsigned int | trg, | ||
int | i, | ||
const string & | localID, | ||
unsigned int | inSynNo, | ||
const string & | postfix | ||
) |
Function for generating the CUDA synapse kernel code that handles presynaptic spikes or spike type events.
os | output stream for code |
model | the neuronal network model to generate code for |
src | the number of the src neuron population |
trg | the number of the target neuron population |
i | the index of the synapse group being processed |
localID | the variable name of the local ID of the thread within the synapse group |
inSynNo | the ID number of the current synapse population as the incoming population to the target neuron population |
postfix | whether to generate code for true spikes or spike type events |
void genNeuronKernel | ( | const NNmodel & | model, |
const string & | path | ||
) |
Function for generating the CUDA kernel that simulates all neurons in the model.
The code generated upon execution of this function is for defining GPU side global variables that will hold model state in the GPU global memory and for the actual kernel function for simulating the neurons for one time step.
Binary flag for the sparse synapses to use atomic operations when the number of connections is bigger than the block size, and shared variables otherwise
Binary flag for the sparse synapses to use atomic operations when the number of connections is bigger than the block size, and shared variables otherwise
model | Model description |
path | Path for code generation |
void genSynapseKernel | ( | const NNmodel & | model, |
const string & | path | ||
) |
Function for generating a CUDA kernel for simulating all synapses.
This functions generates code for global variables on the GPU side that are synapse-related and the actual CUDA kernel for simulating one time step of the synapses.
< "id" if first synapse group, else "lid". lid =(thread index- last thread of the last synapse group)
model | Model description |
path | Path for code generation |
short* isGrpVarNeeded |