Skip to content
Snippets Groups Projects

Draft: C Interfacing

Open Richard Angersbach requested to merge rangersbach/c-interfacing into master
Viewing commit fddcf9dc
Show latest version
5 files
+ 57
4
Preferences
Compare changes
Files
5
@@ -15,6 +15,7 @@ from pystencils import (
@@ -15,6 +15,7 @@ from pystencils import (
)
)
from pystencils.codegen import Kernel
from pystencils.codegen import Kernel
from pystencils.types import create_type, UserTypeSpec, PsType
from pystencils.types import create_type, UserTypeSpec, PsType
 
from pystencilssfg.ir import SfgSourceFileType
from ..context import SfgContext, SfgCursor
from ..context import SfgContext, SfgCursor
from .custom import CustomGenerator
from .custom import CustomGenerator
@@ -716,6 +717,10 @@ class SfgFunctionSequencer(SfgFunctionSequencerBase):
@@ -716,6 +717,10 @@ class SfgFunctionSequencer(SfgFunctionSequencerBase):
"""Sequencer for constructing functions."""
"""Sequencer for constructing functions."""
def __call__(self, *args: SequencerArg) -> None:
def __call__(self, *args: SequencerArg) -> None:
 
# check if header is in HYBRID mode for c_interfacing enabled
 
if self._cursor.context.c_interfacing:
 
assert isinstance(self._cursor.context.header_file.file_type, SfgSourceFileType.HYBRID_HEADER)
 
"""Populate the function body"""
"""Populate the function body"""
tree = make_sequence(*args)
tree = make_sequence(*args)
func = SfgFunction(
func = SfgFunction(