Commit bbfcdc90 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Make generate_c also work if astnode does not have member

`instruction_set`
parent ddb86435
......@@ -49,8 +49,12 @@ def generate_c(ast_node: Node, signature_only: bool = False, dialect='c', custom
if custom_backend:
printer = custom_backend
elif dialect == 'c':
try:
instruction_set = ast_node.instruction_set
except Exception:
instruction_set = None
printer = CBackend(signature_only=signature_only,
vector_instruction_set=ast_node.instruction_set)
vector_instruction_set=instruction_set)
elif dialect == 'cuda':
from pystencils.backends.cuda_backend import CudaBackend
printer = CudaBackend(signature_only=signature_only)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment