brnorris03/Orio

Error when annotating on function out of several

Opened this issue · 3 comments

I have a simple set of linear algebra functions written in C. I added tuning annotations to the add_matrix (~line# 180) function, leaving the others in the file. When I used orcc it errored out with python looking messages; however, when I moved the function and annotations to a unique file it worked fine.
orio_issue.zip

I think your issue is similar to mine, have a look on #12 .
It's a long time that I'm struggling with Orio and could figure out several constraints of the tool. Actually, as you stated, when you have the annotated portion of the code in another file instead of the main file, Orio cannot do the optimization procedure regards to several options and flags because Orio executes the code with GCC compiler each time during its testing procedure while checking the options and profiles the results. At the end, it chooses the options with the least execution time as the best options.
When you annotate the code outside of the main file, it cannot compile the code with GCC to compute the execution time and profile its result because it's not a complete code and does not have the main function to be executable. Thereby, you must move your function inside the main file and then separate your optimized function code outside of the main file, I know it's not a clean way but the only solution that I could find.
I would be appreciated if you have any opinion or other solution to share, good luck.

@mahdifani14
Thanks for the feedback! From my highly limited experience it seems that it is not necessary to have a main function to do the tuning, but it can be useful to initialize data. There are a bunch of good examples in the testsuite/SPAPT directory of the repo as well.

@mastino
Thanks for your info,
I would be appreciated to let me know if you could find any solution and I will do too.