Skip to content

Moving a project built using GeNN v2.1 to v2.2

Esin Yavuz edited this page Jun 24, 2016 · 1 revision

In v2.2 we introduced some new ways of doing things for keeping things simple and flexible. We discontinued some methods that could be done using neuron/synapse variables and parameters since the introduction of flexible building blocks in v2.0. I will go through the errors that I have encountered moving my project, by explaining the reason and how to fix them.

Before starting moving your project, please consider visiting the release notes.

#Errors encountered after upgrading to GeNN v2.2 and how to fix them

  • First you would notice that some includes won't work. Make sure you include only .h files and "yourmodel_CODE/definitions.h" instead of "yourmodel_CODE/runner.cc".

  • If you are using explicit current injection method, you will see an error like the following:

error: identifier "INPRULE" is undefined

This is because explicit input is not supported anymore, as it can also be modelled as a neuron parameter (for a fixed value) or a variable (dynamic value, or different for every neuron in a population). Check how this can be done in the example project Izhikevich 2003.

  • Next thing is to change the calls to buildmodel.sh as genn-buildmodel.sh in your code and change the argument list accordingly (check the new argument list here: genn-buildmodel.sh). buildmodel.sh/bat still exists and calls the new script but it is deprecated and be removed in the next release, so it is better to use the latest version.

In my code I had to change it as following :

Old code:

 cmd = "cd model && buildmodel.sh " + modelName + " " + toString(dbgMode);
   cmd += " && make clean && make";
  if (dbgMode == 1) {
    cmd += " debug";
   }
   else {
     cmd += " release";

New code:

  cmd = "cd model && genn-buildmodel.sh ./" + modelName + ".cc" ;
  cmd += " && make clean && make";
  if (dbgMode == 1) {
    cmd += " -d";
   }
   else {
     cmd += " release";
  • Next errors that I encountered are related to additional arguments to stepTimeGPU() (and to stepTimeCPU()). These functions used to take time and possible other variables as argument.

mymodel_CODE/runner.cc(82): error: variable "t" has already been defined

t is now an internal variable and it is defined in runner.cc. The lines that defined in the user code should be removed.

sim.cc(603): error: no instance of overloaded function "stepTimeGPU" matches the argument list argument types are: (double *, double) Function call should be stepTimeGPU(), with no arguments.

After fixing these, my model now runs as expected on the v2.2 release candidate.

Feel free to share your experience and/or ask questions.

Clone this wiki locally