GeNN  2.2.3
GPU enhanced Neuronal Networks (GeNN)
generateKernels.h File Reference

Contains functions that generate code for CUDA kernels. Part of the code generation section. More...

#include "modelSpec.h"
#include <string>
#include <fstream>

Go to the source code of this file.

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...
 

Detailed Description

Contains functions that generate code for CUDA kernels. Part of the code generation section.

Function Documentation

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.

Parameters
osoutput stream for code
modelthe neuronal network model to generate code for
srcthe number of the src neuron population
trgthe number of the target neuron population
ithe index of the synapse group being processed
localIDthe variable name of the local ID of the thread within the synapse group
inSynNothe ID number of the current synapse population as the incoming population to the target neuron population
postfixwhether 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

Parameters
modelModel description
pathPath 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)

Parameters
modelModel description
pathPath for code generation