Peano
Loading...
Searching...
No Matches
exahype2.api.dslhype2.kernels Namespace Reference

Functions

 generate_namespace (OutputLanguage output_language, Target target, MemoryLayout memory_layout)
 translate_dslhype_function (Solver solver, function, int dimensions, dict[dslhype.Name, dslhype.TFunction] function_map, external_variables, list[PDETerm] pde_terms, str output_file_name, Target target, bool stateless, OutputLanguage output_language=OutputLanguage.CPP, MemoryLayout memory_layout=MemoryLayout.AoS_AllNested, str|None function_name=None, str output_directory=".")
 function_name: str Name of the generated C++ function.
 generate_mlir_function_call_bridges (Solver solver, dict[dslhype.Name, dslhype.TFunction] function_map, list[PDETerm] pde_terms, bool stateless, str output_file_name, str output_directory=".")

Function Documentation

◆ generate_mlir_function_call_bridges()

exahype2.api.dslhype2.kernels.generate_mlir_function_call_bridges ( Solver solver,
dict[dslhype.Name, dslhype.TFunction] function_map,
list[PDETerm] pde_terms,
bool stateless,
str output_file_name,
str output_directory = "." )

Definition at line 215 of file kernels.py.

References assert.

◆ generate_namespace()

exahype2.api.dslhype2.kernels.generate_namespace ( OutputLanguage output_language,
Target target,
MemoryLayout memory_layout )

Definition at line 6 of file kernels.py.

Referenced by translate_dslhype_function().

Here is the caller graph for this function:

◆ translate_dslhype_function()

exahype2.api.dslhype2.kernels.translate_dslhype_function ( Solver solver,
function,
int dimensions,
dict[dslhype.Name, dslhype.TFunction] function_map,
external_variables,
list[PDETerm] pde_terms,
str output_file_name,
Target target,
bool stateless,
OutputLanguage output_language = OutputLanguage.CPP,
MemoryLayout memory_layout = MemoryLayout.AoS_AllNested,
str | None function_name = None,
str output_directory = "." )

function_name: str Name of the generated C++ function.

Defaults to the name of the Python DSL function passed in as function.

output_language: OutputLanguage Language of the generated code. Defaults to C++, but can be MLIR.

output_directory: str Directory the kernels/ subdirectory with the generated files is created in, usually the Peano project's directory.

Remarks
Existing files are appended to, not overwritten Several functions of one project end up in the same files (kernels/{output_file_name}.h and .cpph/.cpp), so the translation appends. Running a generator script a second time in the same directory therefore duplicates the kernels, and the project does not compile ("redefinition of ..."). Remove the kernels/ directory before you regenerate.

Definition at line 23 of file kernels.py.

References generate_namespace().

Here is the call graph for this function: