- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code below crashes at runtime when compiled with Intel Compiler 2022, but not native Clang 13.0 , or Intel 19.2 or GCC 10
Visual Studio 2019, One API 2022, c++17 language. Remove the '&' after the const auto works around the issue.
#include <iostream>
#include <tuple>
#include <vector>
#include <omp.h>
std::vector<std::pair<int, std::vector<int>>> data;
void DoTask(int a, int b)
{
{
#pragma omp critical
std::cout << "Thread " << omp_get_thread_num() << ' ' << a << ',' << b << std::endl;
}
}
void test2()
{
# pragma omp parallel
{
# pragma omp single
{
for (auto iter = data.begin(); iter != data.end(); ++iter)
{
const auto &a = iter->first;
const auto &b = iter->second;
for (const auto &aa : b)
{
if (aa != a)
{
# pragma omp task
DoTask(a, aa);
}
}
}
}
}
}
int main()
{
std::vector<int> tmp({ 1,2,3,4,5,6,7,8,9 });
for (int i = 0; i < 10; i++)
{
data.push_back({ i,tmp });
}
std::cout << "Starting test using iter " << std::endl;
test2();
}
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I get an access violation as per your screen shot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for the confirmation.
We were able to reproduce your issue from our end using visual studio 2019 and Intel compiler 2022 on a windows machine. we are working on your issue internally and will get back to you soon.
Thanks & Regards,
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have released onaAPI 2022.3 which addressed this issue. Please upgrade to this version.
I am going to close this thread.
Thanks,
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page