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

Can't create Z3 or halide code from .sk.out #6

Open
sdorkenw opened this issue Nov 24, 2016 · 4 comments
Open

Can't create Z3 or halide code from .sk.out #6

sdorkenw opened this issue Nov 24, 2016 · 4 comments
Assignees

Comments

@sdorkenw
Copy link
Contributor

I created the simple_loop01.ir, simple_loop01.sk and simple_loop.sk.out as shown in the end-to-end example and they look fine as far as I can tell. Creating the Z3 file and the halide code fails however, both with very similar errors (from the point on where pp.SketchResultProcessor(...).interpret() is called):

[INFO]: Generating backend code from IR file: simple_out/simple_loop0.ir
[INFO]: and sketch output file: sketch/simple_loop0.sk.out
[INFO]: to output file: simple_out/simple_loop0_halide.cpp
Traceback (most recent call last):
File "./stng-backend.py", line 147, in <module>
 gen_backend_code(args)
File "./stng-backend.py", line 82, in gen_backend_code
 postcondition = pp.SketchResultProcessor(skresult.read()).interpret()
File "/home/sdorkenw/stng/backend/process_sketch_results.py", line 235, in interpret
 self.process_generated_func(match.group(1), lineno)
File "/home/sdorkenw/stng/backend/process_sketch_results.py", line 92, in process_generated_func
 self.generated_funcs[name.strip()] = self.interpret_generated_func(self.sketch_result[start_lineno:end_lineno])
File "/home/sdorkenw/stng/backend/process_sketch_results.py", line 177, in interpret_generated_func
 out = sympy.sympify(out)
File "/usr/local/lib/python2.7/dist-packages/sympy/core/sympify.py", line 324, in sympify
 raise SympifyError('could not parse %r' % a, exc)
sympy.core.sympify.SympifyError: Sympify of expression 'could not parse u'in(_out_s21-99)'' failed, because of exception being raised:
SyntaxError: invalid syntax (<string>, line 1)
@shoaibkamil
Copy link
Contributor

Sympy apparently no longer likes variables named in. Fix for this incoming shortly.

@shoaibkamil
Copy link
Contributor

@sdorkenw Please let me know if this isn't now fixed as of baf40a7.

@akcheung
Copy link
Member

akcheung commented Dec 6, 2016

@shoaibkamil would it be easier to stick with an older version of sympy?

@shoaibkamil
Copy link
Contributor

@akcheung It looks like this has been an issue for a while, but I'd used input as my input array.

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

3 participants