|
Peano
|
Turns a PDETerm into the C++ text for its generated method: exactly one method - the static, GPU-offloadable overload if the term is stateless, otherwise the virtual instance method. More...

Public Member Functions | |
| __init__ (self, "PDETerm" term, solver=None) | |
| str | kernel_signature (self) |
| The signature without the auxiliary variables. | |
| str | signature (self) |
| The term's C++ parameter list. | |
| str | generate_declaration (self) |
| Declaration text for the abstract solver header: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - never both from one term. | |
| str | generate_definition (self) |
| Body of the generated method: the term's implementation verbatim. | |
| str | generate_out_of_class_definitions (self, str qualified_class_name) |
| Out-of-class method body for the solver's .cpp file: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - mirrors generate_declaration(), never both from one term. | |
| str | generate_stub_declaration (self) |
| Override declaration for the concrete solver class that the Python API generates when the user hasn't provided their own implementation of this term - the empty string if the term isn't left abstract (term.implementation is not None; a stateless term's method is static and thus never overridable in the first place, but that combination cannot occur anyway,. | |
| str | generate_stub_definition (self, str qualified_class_name) |
| Out-of-class body for generate_stub_declaration(): a trace-in (with x, and normal too if the term's signature has one), a logWarning noting the method is unimplemented, a "// @todo implement" comment, and logTraceOut - or the empty string under the same condition as generate_stub_declaration(). | |
Data Fields | |
| term = term | |
| solver = solver | |
| kernel_signature | |
Protected Member Functions | |
| bool | _has_auxiliary_variables (self) |
| bool | _needs_kernel_adapter (self) |
| The compute kernels know nothing about auxiliary variables. | |
| str | _kernel_adapter_arguments (self) |
| str | _generate_kernel_adapter_declaration (self) |
| str | _generate_kernel_adapter_definition (self, str qualified_class_name) |
| str | _generate_static_offloadable_declaration (self) |
| static GPU-offloadable declaration, or the empty string if the term isn't stateless. | |
Protected Attributes | |
| _has_auxiliary_variables | |
Turns a PDETerm into the C++ text for its generated method: exactly one method - the static, GPU-offloadable overload if the term is stateless, otherwise the virtual instance method.
Never both from the same term;
If term.implementation is None, the method is left for the user to implement by hand: pure virtual (" = 0") for the non-stateless case, or - since static methods cannot be pure virtual - simply declared without a matching out-of-class definition for the stateless case. Otherwise the method is generated non-overridable ("final") with term.implementation as its body.
Embedded into PDETerm (reachable as term.generator) so that a term subclass can supply its own Generator -
Definition at line 85 of file PDETerm.py.
| exahype2.api.PDETerm.PDETerm.Generator.__init__ | ( | self, | |
| "PDETerm" | term, | ||
| solver = None ) |
| term | PDETerm |
| solver | exahype2.api.Solver If the solver has auxiliary variables, the generated signature contains pointers to them (exahype2.api.AuxiliaryVariables). |
Definition at line 109 of file PDETerm.py.
|
protected |
Definition at line 174 of file PDETerm.py.
References _needs_kernel_adapter().
Referenced by generate_declaration().


|
protected |
Definition at line 190 of file PDETerm.py.
References _needs_kernel_adapter().
Referenced by generate_out_of_class_definitions().


|
protected |
static GPU-offloadable declaration, or the empty string if the term isn't stateless.
exahype2.Solver.Offloadable is a dummy tag argument that exists precisely because C++ cannot overload on staticness alone - it is what lets this static method coexist with the same-named, non-static, no-Offloadable-argument method that registering the same term name again without stateless would produce.
Definition at line 206 of file PDETerm.py.
References term.
Referenced by generate_declaration().

|
protected |
Definition at line 120 of file PDETerm.py.
References solver, exahype2::ccz4::ahf::AHBinaryMergerOptions.solver, exahype2::ccz4::ahf::AHCommonHorizonSearchOptions.solver, exahype2::ccz4::ahf::AHFinderOptions.solver, exahype2::ccz4::ahf::AHFinderResult.solver, exahype2::ccz4::ahf::AHMultiHorizonOptions.solver, and exahype2::ccz4::ahf::AHSearchOptions.solver.
|
protected |
Definition at line 169 of file PDETerm.py.
References kernel_signature, solver, exahype2::ccz4::ahf::AHBinaryMergerOptions.solver, exahype2::ccz4::ahf::AHCommonHorizonSearchOptions.solver, exahype2::ccz4::ahf::AHFinderOptions.solver, exahype2::ccz4::ahf::AHFinderResult.solver, exahype2::ccz4::ahf::AHMultiHorizonOptions.solver, and exahype2::ccz4::ahf::AHSearchOptions.solver.
|
protected |
The compute kernels know nothing about auxiliary variables.
They call the stateless terms with the original signature. If the solver has auxiliary variables, we thus add static overloads with the original signature that forward to the term with parameters.
Definition at line 151 of file PDETerm.py.
References _has_auxiliary_variables, and term.
Referenced by _generate_kernel_adapter_declaration(), and _generate_kernel_adapter_definition().

| str exahype2.api.PDETerm.PDETerm.Generator.generate_declaration | ( | self | ) |
Declaration text for the abstract solver header: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - never both from one term.
Pure virtual (" = 0") if term.implementation is None, "final" otherwise; the static, stateless overload is unaffected by this distinction (static methods cannot be pure virtual) -
Definition at line 231 of file PDETerm.py.
References _generate_kernel_adapter_declaration(), _generate_static_offloadable_declaration(), and term.

| str exahype2.api.PDETerm.PDETerm.Generator.generate_definition | ( | self | ) |
Body of the generated method: the term's implementation verbatim.
Only meaningful when term.implementation is not None -
Definition at line 254 of file PDETerm.py.
References term.
Referenced by generate_out_of_class_definitions().

| str exahype2.api.PDETerm.PDETerm.Generator.generate_out_of_class_definitions | ( | self, | |
| str | qualified_class_name ) |
Out-of-class method body for the solver's .cpp file: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - mirrors generate_declaration(), never both from one term.
The empty string if term.implementation is None: the user implements that method by hand instead, whether as an override of the pure virtual instance method or, for a stateless term, as an ordinary static method matching the declaration (name hiding, not override - static methods cannot be virtual).
qualified_class_name: str Fully qualified class name the definition is attached to, e.g. "examples::MySolver::AbstractMySolver".
Definition at line 263 of file PDETerm.py.
References _generate_kernel_adapter_definition(), generate_definition(), and term.

| str exahype2.api.PDETerm.PDETerm.Generator.generate_stub_declaration | ( | self | ) |
Override declaration for the concrete solver class that the Python API generates when the user hasn't provided their own implementation of this term - the empty string if the term isn't left abstract (term.implementation is not None; a stateless term's method is static and thus never overridable in the first place, but that combination cannot occur anyway,.
Definition at line 301 of file PDETerm.py.
References term.
| str exahype2.api.PDETerm.PDETerm.Generator.generate_stub_definition | ( | self, | |
| str | qualified_class_name ) |
Out-of-class body for generate_stub_declaration(): a trace-in (with x, and normal too if the term's signature has one), a logWarning noting the method is unimplemented, a "// @todo implement" comment, and logTraceOut - or the empty string under the same condition as generate_stub_declaration().
qualified_class_name: str Fully qualified class name the definition is attached to, e.g. "examples::MySolver::MySolver".
Reimplemented in exahype2.api.GradientRefinement.GradientRefinement.Generator.
Definition at line 319 of file PDETerm.py.
References signature(), and term.

| str exahype2.api.PDETerm.PDETerm.Generator.kernel_signature | ( | self | ) |
The signature without the auxiliary variables.
This is the signature which the compute kernels call.
Definition at line 124 of file PDETerm.py.
References term.
| str exahype2.api.PDETerm.PDETerm.Generator.signature | ( | self | ) |
The term's C++ parameter list.
Looked up as a SIGNATURE attribute on the owning term (e.g. Flux.SIGNATURE); a plain, custom PDETerm has to set term.SIGNATURE itself before it can generate code.
Definition at line 132 of file PDETerm.py.
References term.
Referenced by generate_stub_definition().

|
protected |
Definition at line 145 of file PDETerm.py.
Referenced by _needs_kernel_adapter().
| exahype2.api.PDETerm.PDETerm.Generator.kernel_signature |
Definition at line 165 of file PDETerm.py.
Referenced by _kernel_adapter_arguments().
| exahype2.api.PDETerm.PDETerm.Generator.solver = solver |
Definition at line 117 of file PDETerm.py.
Referenced by _has_auxiliary_variables(), and _kernel_adapter_arguments().
| exahype2.api.PDETerm.PDETerm.Generator.term = term |
Definition at line 116 of file PDETerm.py.
Referenced by _generate_static_offloadable_declaration(), _needs_kernel_adapter(), generate_declaration(), generate_definition(), generate_out_of_class_definitions(), generate_stub_declaration(), exahype2.api.GradientRefinement.GradientRefinement.Generator.generate_stub_definition(), generate_stub_definition(), kernel_signature(), and signature().