CPPCodeGenerator class

(Shortest import: from brian2 import CPPCodeGenerator)

class brian2.codegen.generators.cpp_generator.CPPCodeGenerator(*args, **kwds)[source]

Bases: brian2.codegen.generators.base.CodeGenerator

C++ language

C++ code templates should provide Jinja2 macros with the following names:

main
The main loop.
support_code
The support code (function definitions, etc.), compiled in a separate file.

For user-defined functions, there are two keys to provide:

support_code
The function definition which will be added to the support code.
hashdefine_code
The #define code added to the main loop.

See TimedArray for an example of these keys.

Attributes

flush_denormals
restrict

Methods

denormals_to_zero_code()
determine_keywords()
get_array_name(var[, access_data])
translate_expression(expr)
translate_one_statement_sequence(statements)
translate_statement(statement)
translate_to_declarations(statements)
translate_to_read_arrays(statements)
translate_to_statements(statements)
translate_to_write_arrays(statements)

Details

flush_denormals
restrict
denormals_to_zero_code()[source]
determine_keywords()[source]
static get_array_name(var, access_data=True)[source]
translate_expression(expr)[source]
translate_one_statement_sequence(statements, scalar=False)[source]
translate_statement(statement)[source]
translate_to_declarations(statements)[source]
translate_to_read_arrays(statements)[source]
translate_to_statements(statements)[source]
translate_to_write_arrays(statements)[source]