symforce.codegen.backends.slang.slang_config module¶
- class SlangConfig(doc_comment_line_prefix=' * ', line_length=100, use_eigen_types=False, render_template_config=<factory>, cse_optimizations=None, zero_epsilon_behavior=<factory>, normalize_results=True, override_methods=None, builtin_vector_variables=<factory>)[source]¶
Bases:
CodegenConfigCode generation config for the Slang backend.
- Parameters:
doc_comment_line_prefix (str) – Prefix applied to each line in a docstring
line_length (int) – Maximum allowed line length in docstrings; used for formatting docstrings.
use_eigen_types (bool) – Use eigen_lcm types for vectors instead of lists (not supported in Slang)
override_methods (Dict[Function, str] | None) – Add special function overrides in dictionary with symforce function keys
builtin_vector_variables (Set[str]) – Names of inputs and outputs that should use Slang’s built-in vector types (float2/float3/float4) instead of fixed-size arrays
render_template_config (RenderTemplateConfig)
cse_optimizations (Literal['basic'] | ~typing.Sequence[~typing.Tuple[~typing.Callable, ~typing.Callable]] | None)
zero_epsilon_behavior (ZeroEpsilonBehavior)
normalize_results (bool)
- classmethod backend_name()[source]¶
String name for the backend. This should match the directory name in codegen/backends and will be used to namespace by backend in generated code.
- Return type:
- static templates_to_render(generated_file_name)[source]¶
Given a single symbolic function’s filename, provide one or more Jinja templates to render and the relative output paths where they should go.