GeNN  3.3.0
GPU enhanced Neuronal Networks (GeNN)
generateRunner.cc File Reference

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

#include "generateRunner.h"
#include "global.h"
#include "utils.h"
#include "codeGenUtils.h"
#include "codeStream.h"
#include <algorithm>
#include <cfloat>
#include <cstdint>

Functions

void genDefinitions (const NNmodel &model, const string &path, int localHostID)
 A function that generates predominantly host-side code. More...
 
void genSupportCode (const NNmodel &model, const string &path)
 Path for code generationn. More...
 
void genRunner (const NNmodel &model, const string &path, int localHostID)
 ID of local host. More...
 
void genRunnerGPU (const NNmodel &model, const string &path, int localHostID)
 A function to generate the code that simulates the model on the GPU. More...
 
void genMSBuild (const NNmodel &model, const string &path)
 A function that generates an MSBuild script for all generated GeNN code. More...
 
void genMakefile (const NNmodel &model, const string &path)
 A function that generates the Makefile for all generated GeNN code. More...
 

Detailed Description

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.

Function Documentation

◆ genDefinitions()

void genDefinitions ( const NNmodel model,
const string &  path,
int  localHostID 
)

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.

Parameters
modelModel description
pathPath for code generationn
localHostIDHost ID of local machine

◆ genMakefile()

void genMakefile ( const NNmodel model,
const string &  path 
)

A function that generates the Makefile for all generated GeNN code.

Path for code generation

Parameters
modelModel description
pathPath for code generation

◆ genMSBuild()

void genMSBuild ( const NNmodel model,
const string &  path 
)

A function that generates an MSBuild script for all generated GeNN code.

Path for code generation

Parameters
modelModel description
pathPath for code generation

◆ genRunner()

void genRunner ( const NNmodel model,
const string &  path,
int  localHostID 
)

ID of local host.

Method for cleaning up and resetting device while quitting GeNN

Parameters
modelModel description
pathPath for code generationn
localHostIDID of local host

◆ genRunnerGPU()

void genRunnerGPU ( const NNmodel model,
const string &  path,
int  localHostID 
)

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.

Parameters
modelModel description
pathPath for code generation
localHostIDID of local host

◆ genSupportCode()

void genSupportCode ( const NNmodel model,
const string &  path 
)

Path for code generationn.

Parameters
modelModel description
pathPath for code generationn