Skip to content
Snippets Groups Projects
Commit e55c5d8a authored by Martin Bauer's avatar Martin Bauer
Browse files

Bugfix in typing

parent 0cc3b825
No related branches found
No related tags found
No related merge requests found
...@@ -42,12 +42,11 @@ def create_kernel(assignments: AssignmentOrAstNodeList, function_name: str = "ke ...@@ -42,12 +42,11 @@ def create_kernel(assignments: AssignmentOrAstNodeList, function_name: str = "ke
Returns: Returns:
AST node representing a function, that can be printed as C or CUDA code AST node representing a function, that can be printed as C or CUDA code
""" """
def type_symbol(term): def type_symbol(term):
if isinstance(term, Field.Access) or isinstance(term, TypedSymbol): if isinstance(term, Field.Access) or isinstance(term, TypedSymbol):
return term return term
elif isinstance(term, sp.Symbol): elif isinstance(term, sp.Symbol):
if not hasattr(type_info, '__getitem__'): if isinstance(type_info, str) or not hasattr(type_info, '__getitem__'):
return TypedSymbol(term.name, create_type(type_info)) return TypedSymbol(term.name, create_type(type_info))
else: else:
return TypedSymbol(term.name, type_info[term.name]) return TypedSymbol(term.name, type_info[term.name])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment