GeNN
4.9.0
GPU enhanced Neuronal Networks (GeNN)
|
#include <algorithm>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#include <regex>
#include "gennExport.h"
#include "gennUtils.h"
#include "neuronGroupInternal.h"
#include "variableMode.h"
#include "backendBase.h"
#include "codeStream.h"
#include "substitutions.h"
#include "teeStream.h"
Go to the source code of this file.
Namespaces | |
CodeGenerator | |
Helper class for generating code - automatically inserts brackets, indents etc. | |
Functions | |
GENN_EXPORT void | CodeGenerator::substitute (std::string &s, const std::string &trg, const std::string &rep) |
Tool for substituting strings in the neuron code strings or other templates. More... | |
GENN_EXPORT bool | CodeGenerator::regexVarSubstitute (std::string &s, const std::string &trg, const std::string &rep) |
Tool for substituting variable names in the neuron code strings or other templates using regular expressions. More... | |
GENN_EXPORT bool | CodeGenerator::regexFuncSubstitute (std::string &s, const std::string &trg, const std::string &rep) |
Tool for substituting function names in the neuron code strings or other templates using regular expressions. More... | |
GENN_EXPORT void | CodeGenerator::functionSubstitute (std::string &code, const std::string &funcName, unsigned int numParams, const std::string &replaceFuncTemplate) |
This function substitutes function calls in the form: More... | |
size_t | CodeGenerator::ceilDivide (size_t numerator, size_t denominator) |
Divide two integers, rounding up i.e. effectively taking ceil. More... | |
size_t | CodeGenerator::padSize (size_t size, size_t blockSize) |
Pad an integer to a multiple of another. More... | |
GENN_EXPORT void | CodeGenerator::genTypeRange (CodeStream &os, const std::string &precision, const std::string &prefix) |
GENN_EXPORT std::string | CodeGenerator::ensureFtype (const std::string &oldcode, const std::string &type) |
This function implements a parser that converts any floating point constant in a code snippet to a floating point constant with an explicit precision (by appending "f" or removing it). More... | |
GENN_EXPORT std::string | CodeGenerator::getReductionInitialValue (const BackendBase &backend, VarAccessMode access, const std::string &type) |
Get the initial value to start reduction operations from. More... | |
GENN_EXPORT std::string | CodeGenerator::getReductionOperation (const std::string &reduction, const std::string &value, VarAccessMode access, const std::string &type) |
Generate a reduction operation to reduce value into reduction. More... | |
GENN_EXPORT void | CodeGenerator::checkUnreplacedVariables (const std::string &code, const std::string &codeName) |
This function checks for unknown variable definitions and returns a gennError if any are found. More... | |
GENN_EXPORT std::string | CodeGenerator::disambiguateNamespaceFunction (const std::string supportCode, const std::string code, std::string namespaceName) |
This function substitutes function names in a code with namespace as prefix of the function name for backends that do not support namespaces by checking that the function indeed exists in the support code and returns the substituted code. More... | |
template<typename P , typename D , typename V , typename S > | |
void | CodeGenerator::neuronSubstitutionsInSynapticCode (CodeGenerator::Substitutions &substitutions, const NeuronGroupInternal *archetypeNG, const std::string &delayOffset, const std::string &sourceSuffix, const std::string &destSuffix, const std::string &varPrefix, const std::string &varSuffix, bool useLocalNeuronVars, P isParamHeterogeneousFn, D isDerivedParamHeterogeneousFn, V getVarIndexFn, S getPrevSpikeTimeIndexFn) |
Function for performing the code and value substitutions necessary to insert neuron related variables, parameters, and extraGlobal parameters into synaptic code. More... | |
template<typename G , typename K > | |
bool | CodeGenerator::isKernelSizeHeterogeneous (const G *group, size_t dimensionIndex, K getKernelSizeFn) |
template<typename G , typename K > | |
std::string | CodeGenerator::getKernelSize (const G *group, size_t dimensionIndex, K getKernelSizeFn) |
template<typename G , typename K > | |
void | CodeGenerator::genKernelIndex (const G *group, std::ostream &os, const CodeGenerator::Substitutions &subs, K getKernelSizeFn) |