Skip to content

Commit

Permalink
Fix or comment other minor comments in PR #12
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoConti committed Nov 12, 2024
1 parent a3ee2a1 commit d870e25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 1 addition & 9 deletions Deeploy/Targets/Generic/TypeCheckers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,11 @@ def _inferSignedness(self, inputs: List[VariableBuffer],
return [False]


class FloatAddChecker(SignPropTypeChecker):
class FloatAddChecker(NodeTypeChecker):

def __init__(self, input_types: Sequence[Type[Pointer]], output_types: Sequence[Type[Pointer]]):
super().__init__(input_types, output_types)

def _inferNumLevels(self, inputs: List[VariableBuffer],
operatorRepresentation: OperatorRepresentation) -> List[int]:
return [inputs[0].nLevels + inputs[1].nLevels]

def _inferSignedness(self, inputs: List[VariableBuffer],
operatorRepresentation: OperatorRepresentation) -> List[bool]:
return [True]


class GatherChecker(SignPropTypeChecker):

Expand Down
3 changes: 3 additions & 0 deletions DeeployTest/testUtils/typeMapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def inferInputType(_input: np.ndarray,

matchingTypes = []

# FIXME: this is okay for now (3 distinctions are fine), but there is implicit
# knowledge encoded in the order of the checks (i.e. first unsigned, signed
# and then float). It might be good to extract that implicit knowledge into an ordered list.
if signProp and isUnsigned(_input) and isInteger(_input):
for _type in sorted(signedPlatformTypes, key = lambda x: x.typeWidth):
signPropOffset = (2**(_type.typeWidth - 1))
Expand Down

0 comments on commit d870e25

Please sign in to comment.