Hi Johned,
Yes I did try it.
Memory limitations for instructions per thread
-
- Active Member
- Posts: 61
- Joined: Tue Feb 13, 2018 2:50 pm
-
Verified
- Junior Member
- Posts: 4
- Joined: Thu Oct 04, 2018 2:09 pm
At Johned's suggestion, I separated the different loop limits into different source files. So file mixer1900.xc had a copy of the calculation function, and one function calling it with 1900. And file mixer.xc had an identical copy of the calculation function, and the other functions calling it with 2000.
With -O0, the calculation function was not inlined, and the loop was unrolled.
With -O3, the calculation function was not inlined, but the loop was unrolled.
So using separate source files is a workaround to force unrolling of a loop called with different limits.
We were hoping this would help to avoid error-prone manual unrolling.
With -O0, the calculation function was not inlined, and the loop was unrolled.
With -O3, the calculation function was not inlined, but the loop was unrolled.
So using separate source files is a workaround to force unrolling of a loop called with different limits.
We were hoping this would help to avoid error-prone manual unrolling.
-
- Active Member
- Posts: 61
- Joined: Tue Feb 13, 2018 2:50 pm
Thank you Nigel for your help. I didn't get what you mean with :
At last, I extracted the calculation to one other module/project which I builtat -O2 optimization level (with module_build_info file) . My main application calls this module and is built at -O3. It works fine, but it is just a workaround to the compiler error.
Your suggestion to copy the function seems to be similar to mine. However, in case the calculation function is a bit tricky and regularly fine-tuned, to copy-paste it in several files is not a lasting solution I think.
Thank you anyway for your help, I hope the compiler error would be solved and I will try with the workaround solution for a little while.
Best regards,
Marc
Maybe it's missing a "not" somewhere.With -O0, the calculation function was not inlined, and the loop was unrolled.
With -O3, the calculation function was not inlined, but the loop was unrolled.
At last, I extracted the calculation to one other module/project which I builtat -O2 optimization level (with module_build_info file) . My main application calls this module and is built at -O3. It works fine, but it is just a workaround to the compiler error.
Your suggestion to copy the function seems to be similar to mine. However, in case the calculation function is a bit tricky and regularly fine-tuned, to copy-paste it in several files is not a lasting solution I think.
Thank you anyway for your help, I hope the compiler error would be solved and I will try with the workaround solution for a little while.
Best regards,
Marc
-
Verified
- Junior Member
- Posts: 4
- Joined: Thu Oct 04, 2018 2:09 pm
Sorry Marc! You are right, a missing "not":
With -O0, the calculation function was not inlined, and the loop was NOT unrolled.
With -O3, the calculation function was not inlined, but the loop WAS unrolled.
But I don't understand what you mean by the compiler error. Do you mean it should always unroll on a "pragma loop unroll"?
With -O0, the calculation function was not inlined, and the loop was NOT unrolled.
With -O3, the calculation function was not inlined, but the loop WAS unrolled.
But I don't understand what you mean by the compiler error. Do you mean it should always unroll on a "pragma loop unroll"?
-
- Active Member
- Posts: 61
- Joined: Tue Feb 13, 2018 2:50 pm
Hi Nigel,
Thank you for the clarifications.
As such it is not exactly a compiler error, rather an hidden limitation .
Thank you for the clarifications.
Yes that what I hoped from such pragma. Or else that the documentation clarifies this by indicating what is possible and what is not. Unroll pragma and inline expansion are not clearly related and to choose a target for a project, that would be a useful information to know the limitation.But I don't understand what you mean by the compiler error. Do you mean it should always unroll on a "pragma loop unroll"?
As such it is not exactly a compiler error, rather an hidden limitation .
-
Verified
- Junior Member
- Posts: 4
- Joined: Thu Oct 04, 2018 2:09 pm
Thanks Marc. I've raised an internal bug report to rationalise, or at least document, the behaviour.
-
- Active Member
- Posts: 61
- Joined: Tue Feb 13, 2018 2:50 pm
Thanks Nigel, this will be greatly appreciated.