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

Main file combining the code for code generation. Part of the code generation section. More...

#include "global.h"
#include "generateALL.h"
#include "generateCPU.h"
#include "generateInit.h"
#include "generateKernels.h"
#include "generateMPI.h"
#include "generateRunner.h"
#include "modelSpec.h"
#include "utils.h"
#include "codeGenUtils.h"
#include "codeStream.h"
#include <algorithm>
#include <cmath>
#include <iterator>
#include <sys/stat.h>
#include <MODEL>

Functions

void generate_model_runner (const NNmodel &model, const string &path, int localHostID)
 This function will call the necessary sub-functions to generate the code for simulating a model. More...
 
void chooseDevice (NNmodel &model, const string &path, int localHostID)
 Helper function that prepares data structures and detects the hardware properties to enable the code generation code that follows. More...
 
int main (int argc, char *argv[])
 Main entry point for the generateALL executable that generates the code for GPU and CPU. More...
 

Detailed Description

Main file combining the code for code generation. Part of the code generation section.

The file includes separate files for generating kernels (generateKernels.cc), generating the CPU side code for running simulations on either the CPU or GPU (generateRunner.cc) and for CPU-only simulation code (generateCPU.cc).

Function Documentation

◆ chooseDevice()

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

Helper function that prepares data structures and detects the hardware properties to enable the code generation code that follows.

The main tasks in this function are the detection and characterization of the GPU device present (if any), choosing which GPU device to use, finding and appropriate block size, taking note of the major and minor version of the CUDA enabled device chosen for use, and populating the list of standard neuron models. The chosen device number is returned.

Parameters
modelthe nn model we are generating code for
pathpath the generated code will be deposited
localHostIDID of local host

◆ generate_model_runner()

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

This function will call the necessary sub-functions to generate the code for simulating a model.

ID of local host

Parameters
modelModel description
pathPath where the generated code will be deposited
localHostIDID of local host

◆ main()

int main ( int  argc,
char *  argv[] 
)

Main entry point for the generateALL executable that generates the code for GPU and CPU.

The main function is the entry point for the code generation engine. It prepares the system and then invokes generate_model_runner to inititate the different parts of actual code generation.

Parameters
argcnumber of arguments; expected to be 2
argvArguments; expected to contain the target directory for code generation.