Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Lambda problems?

P_A__Jimenez
Beginner
381 Views
Hi.
I am trying to re-build an existing program with the Intel C++ compiler included with Intel C++ Studio. The version of the compiler I am using is the latest available (12.1, Update 8). I had to change a few pieces of code here and there to remove some errors and warnings that the Visual C++ 10 compiler did not complain about, but just minor things.
The first problem I am having, which I have experienced before, is that debugging can be a nightmare. For some reason std containers with complex objects show only "(error) 0" as their data. I had reported this issue with std::deque already, and it seems you got it fixed. Now I am having the same kind of issue with std::unordered_map. Could it be again that an internal attribute is being, in a way, removed, causing the debugger not to find it? That was the issue last time with std::deque.
The big issue, however, and reason for this post, is that the code is doing things badly. It looks like improperly generated code in the form of the wrong lambda being called. Let me explain further: for this new program I have been using lambdas a lot, in many ways. In some places I use lambdas to feed TBB algorithms, in others to feed std algorithms (mostly std::for_each), I also use them with std::function in a simple object that all it does is execute it on destruction (a sort of clean-up object) and I also use lambdas inside lambdas with combinations of any of the previously mentioned uses (like a tbb::parallel_for calling a lambda that runs another tbb::parallel_for that runs an std::for_each, ...).
Once I started to debug pieces of code that were causing access violations or improper results, I found the program was executing pieces of code that it was not supposed to execute there, like running another lambda or what seemed to be running the body of a previous for loop instead of a lambda (which did quite different things). I verified with the disassembly view what kind of code it was executing, and it was indeed calling functions that had nothing to do with the lambda I had provided.
Are there any knonw issues regarding nested lambdas?
I wish I had a simple piece of code to give you for you to try it, but I got none at hand. The project is rather big at the moment, and it has been working properly with Microsoft's compiler. I am afraid creating a proper test case would take me too long, but, maybe, this report gives you an idea of what may be wrong.
Best regards,
Pal.
0 Kudos
5 Replies
JenniferJ
Moderator
381 Views

As for the run-time problem, from the symptoms the root cause is most likelythe same as this issue. The bug has been fixed and should be available in the next 12.1 update 9. It should be available soon this month.

Please wait for the update 9 and let us know if it fixed the run-time issue for you.

For the debug issue, is it possible to create a testcase?

thanks,
Jennifer

0 Kudos
JenniferJ
Moderator
381 Views
does your code contain "#include "? If it does, it'sprobably the same issue.

Thanks for the testcase. Let me try to reproduce the debug issue.

Jennifer
0 Kudos
P_A__Jimenez
Beginner
381 Views
Hi.
The initial problem seems to have been fixed with Update 9.
Were you able to reproduce the debugging issue?
Pal.
0 Kudos
JenniferJ
Moderator
381 Views
Thanks for checking the update 9. It's great that the run-time issue is fixed.

About the debug issue I duplicated it with update 9, and have filed a bug report for it. I'll let you know when there is any update.

thanks,
Jennifer
0 Kudos
P_A__Jimenez
Beginner
381 Views
About the debug issue: I just gave the latest Beta of composer a go with the test case. It's working for unordered_set now, but still showing (error) for unordered_map. Do you know if it's planned to have this issue fixed in the final release?
Thanks.
0 Kudos
Reply