diff --git a/src/pystencils/backend/ast/structural.py b/src/pystencils/backend/ast/structural.py index e2f202f6594b8591903531ba795be251b6b544d6..3ae462c41c0170dcaa4a27adbd6d039df8c099d8 100644 --- a/src/pystencils/backend/ast/structural.py +++ b/src/pystencils/backend/ast/structural.py @@ -320,7 +320,7 @@ class PsPragma(PsLeafMixIn, PsEmptyLeafMixIn, PsAstNode): Example usage: ``PsPragma("omp parallel for")`` translates to ``#pragma omp parallel for``. Args: - text: The pragmas text, without the ``#pragma``. + text: The pragma's text, without the ``#pragma``. """ __match_args__ = ("text",) diff --git a/src/pystencils/backend/emission.py b/src/pystencils/backend/emission.py index e976159cfb3c11db19765a26d068190340d5ce9c..6196d69bee44be11d48d2e3e18e731a730fb47d4 100644 --- a/src/pystencils/backend/emission.py +++ b/src/pystencils/backend/emission.py @@ -50,11 +50,13 @@ from .ast.expressions import ( PsLt, PsGe, PsLe, - PsSubscript + PsSubscript, + PsBufferAcc, ) from .extensions.foreign_ast import PsForeignExpression +from .exceptions import PsInternalCompilerError from .memory import PsSymbol from ..types import PsScalarType, PsArrayType @@ -386,6 +388,12 @@ class CAstPrinter: foreign_code = node.get_code(self.visit(c, pc) for c in children) pc.pop_op() return foreign_code + + case PsBufferAcc(): + raise PsInternalCompilerError( + f"Unable to print C code for buffer access {node}.\n" + f"Buffer accesses must be lowered using the `LowerToC` pass before emission." + ) case _: raise NotImplementedError(f"Don't know how to print {node}")