- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Intel team it's me again.
I would like to know how to parallelize this:
//#pragma acc parallel loop
for(i=0; i<targets; i++)
{
//#pragma acc loop
for(j=0; j<lines_samples; j++)
{
if(i == (targets-1)) x_p[i*lines_samples+j] = 0;
u[i] += pow(x_p[i*lines_samples+j], 2);
}
if(sum1 < u[i]) sum1 = u[i]; // Does this make it unparallelizable?
}
The problem is that last line. I tried to parallelize it like this:
my_queue.submit([&](auto &h) {
h.parallel_for(sycl::range<2>(targets,lines_samples), [=](auto index) {
int i = index[0];
int j = index[1];
if(i == (targets-1)) x_p[i*lines_samples+j] = 0;
u[i] += pow(x_p[i*lines_samples+j], 2);
});
}).wait();
But as you can see, I don't know where to put that last line so the behaviour is the same. That line is supposed to be executed only once per i iteration.
Looking forward to your answer.
Thank you!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us, we are working on your issue.
Please refer the below DPCPP/SYCL documentation for migration.
https://www.intel.com/content/www/us/en/developer/tools/oneapi/data-parallel-c-plus-plus.html
Thanks & Regards,
Manjula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since, you were already using OpenACC an easier approach if you want to offload to Intel GPU's will be through the use of OpenMP Offload. Is there any particular reasons why you aren't using OpenMP Offload? As far as your SYCL code is concerned we need to rewrite the code a bit. You can put a for loop inside parallel_for region as well. Please refer https://github.com/oneapi-src/oneAPI-samples/blob/a8b6d2bd93ac5a251400ec1fed0cd94f565bf743/DirectProgramming/DPC%2B%2B/DenseLinearAlgebra/matrix_mul/src/matrix_mul_dpcpp.cpp
Please let me know if you have further queries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let us know if the provided solution solved the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Closing this thread as there was no response from the customer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page