Skip to content
Snippets Groups Projects
Commit 6a205065 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

removed unnecessary undetType + minor fixes

parent 32076b2c
Branches
Tags
No related merge requests found
Pipeline #61681 failed
......@@ -46,14 +46,13 @@ class PsKernelParametersSpec:
elif var in self.params:
continue
else:
raise PsInternalCompilerError(
"Constrained parameter was neither contained in kernel parameter list "
"nor associated with a kernel array.\n"
f" Parameter: {var}\n"
f" Constraint: {constraint.condition}"
)
raise PsInternalCompilerError(
"Constrained parameter was neither contained in kernel parameter list "
"nor associated with a kernel array.\n"
f" Parameter: {var}\n"
f" Constraint: {constraint.condition}"
)
class PsKernelFunction(PsAstNode):
......
......@@ -19,8 +19,9 @@ NodeT = TypeVar("NodeT", bound=PsAstNode)
class EraseAnonymousStructTypes(IdentityMapper):
"""Lower anonymous struct arrays to a byte-array representation.
Arrays whose element type is an anonymous struct are transformed to arrays with element type UInt(8).
Lookups on accesses into these arrays are transformed using type casts.
For arrays whose element type is an anonymous struct, the struct type is erased from the base pointer,
making it a pointer to uint8_t.
Member lookups on accesses into these arrays are then transformed using type casts.
"""
def __init__(self, ctx: KernelCreationContext) -> None:
......
from __future__ import annotations
from typing import TypeVar, Any, NoReturn
from typing import TypeVar, Any
import pymbolic.primitives as pb
from pymbolic.mapper import Mapper
......@@ -10,7 +10,6 @@ from ..types import PsAbstractType, PsNumericType, PsStructType, deconstify
from ..typed_expressions import PsTypedVariable, PsTypedConstant, ExprOrConstant
from ..arrays import PsArrayAccess
from ..ast import PsAstNode, PsBlock, PsExpression, PsAssignment
from ..exceptions import PsInternalCompilerError
__all__ = ["Typifier"]
......@@ -22,40 +21,6 @@ class TypificationError(Exception):
NodeT = TypeVar("NodeT", bound=PsAstNode)
class UndeterminedType(PsNumericType):
"""Placeholder for types that could not yet be determined by the typifier.
Instances of this class should never leave the typifier; it is an error if they do.
"""
def create_constant(self, value: Any) -> Any:
return None
def _err(self) -> NoReturn:
raise PsInternalCompilerError("Calling UndeterminedType.")
def create_literal(self, value: Any) -> str:
self._err()
def is_int(self) -> bool:
self._err()
def is_sint(self) -> bool:
self._err()
def is_uint(self) -> bool:
self._err()
def is_float(self) -> bool:
self._err()
def __eq__(self, other: object) -> bool:
self._err()
def c_string(self) -> str:
self._err()
class DeferredTypedConstant(PsTypedConstant):
"""Special subclass for constants whose types cannot be determined yet at the time of their creation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment