Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating numpy array of NaN crashes compiler #1051

Closed
sbourdeauducq opened this issue Jun 5, 2018 · 0 comments
Closed

creating numpy array of NaN crashes compiler #1051

sbourdeauducq opened this issue Jun 5, 2018 · 0 comments
Assignees
Milestone

Comments

@sbourdeauducq
Copy link
Member

import numpy as np
from artiq.experiment import *


class FX(EnvExperiment):
    def build(self):
        self.setattr_device("core")

    @kernel
    def run(self):
        np.full(3, np.nan)
$ artiq_compile.py fx.py 
<function make_array>
Traceback (most recent call last):
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 76, in <module>
    main()
  File "/home/sb/artiq/artiq/frontend/artiq_compile.py", line 58, in main
    attribute_writeback=False, print_as_rpc=False)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 106, in compile
    library = target.compile_and_link([module])
  File "/home/sb/artiq/artiq/compiler/targets.py", line 187, in compile_and_link
    return self.link([self.assemble(self.compile(module)) for module in modules])
  File "/home/sb/artiq/artiq/compiler/targets.py", line 187, in <listcomp>
    return self.link([self.assemble(self.compile(module)) for module in modules])
  File "/home/sb/artiq/artiq/compiler/targets.py", line 141, in compile
    llmod = module.build_llvm_ir(self)
  File "/home/sb/artiq/artiq/compiler/module.py", line 93, in build_llvm_ir
    attribute_writeback=self.attribute_writeback)
  File "/home/sb/artiq/artiq/compiler/transforms/llvm_ir_generator.py", line 492, in process
    self.process_function(func)
  File "/home/sb/artiq/artiq/compiler/transforms/llvm_ir_generator.py", line 654, in process_function
    llinsn = getattr(self, "process_" + type(insn).__name__)(insn)
  File "/home/sb/artiq/artiq/compiler/transforms/llvm_ir_generator.py", line 1575, in process_Quote
    return self._quote(insn.value, insn.type, lambda: [repr(insn.value)])
  File "/home/sb/artiq/artiq/compiler/transforms/llvm_ir_generator.py", line 1510, in _quote
    return _quote_attributes()
  File "/home/sb/artiq/artiq/compiler/transforms/llvm_ir_generator.py", line 1490, in _quote_attributes
    lambda: path() + [attr])
  File "/home/sb/artiq/artiq/compiler/transforms/llvm_ir_generator.py", line 1571, in _quote
    assert False, fail_msg
AssertionError: at <module 'numpy' from '/home/sb/miniconda3/envs/py35/lib/python3.5/site-packages/numpy/__init__.py'>.full
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants