GSLContainer class¶
(Shortest import: from brian2.stateupdaters.GSL import GSLContainer)
- class brian2.stateupdaters.GSL.GSLContainer(method_options, integrator, abstract_code=None, needed_variables=None, variable_flags=None)[source]¶
Bases:
objectClass that contains information (equation- or integrator-related) required for later code generation
Methods
__call__(obj)Transfer the code object class saved in self to the object sent as an argument.
Return codeobject class based on target language and device.
Details
- __call__(obj)[source]¶
Transfer the code object class saved in self to the object sent as an argument.
This method is returned when calling
GSLStateUpdater. This class inherits fromStateUpdateMethodwhich orignally only returns abstract code. However, with GSL this returns a method because more is needed than just the abstract code: the state updater requires its own CodeObject that is different from the otherNeuronGroupobjects. This method adds thisCodeObjectto theStateUpdaterobject (and also adds the variables ‘t’, ‘dt’, and other variables that are needed in theGSLCodeGenerator.- Parameters:
obj :
GSLStateUpdaterthe object that the codeobj_class and other variables need to be transferred to
- Returns:
abstract_code : str
The abstract code (translated equations), that is returned conventionally by brian and used for later code generation in the
CodeGenerator.translatemethod.
- get_codeobj_class()[source]¶
Return codeobject class based on target language and device.
Choose which version of the GSL
CodeObjectto use. If`isinstance(device, CPPStandaloneDevice)`, then we want theGSLCPPStandaloneCodeObject. Otherwise the return value is based on prefs.codegen.target.- Returns:
code_object : class
The respective
CodeObjectclass (i.e. eitherGSLCythonCodeObjectorGSLCPPStandaloneCodeObject).