Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

error: sycl::_V1::exception wrong loction

lzy
Beginner
2,593 Views

Hello,

I have met a problem, the error code is:

There is an unhandled exception at 0x00007FFBDB684C3C (located in two_d.exe): Microsoft C++Exception: syncl::V1::exception, located at memory location 0x000000605F988C00.

 

My GPU version: Intel(R) Iris(R) Xe Graphics

My Visual Studio Version: Microsoft Visual Studio Professional 2022 17.3.6

BTW, I do can run oneapi dpc++ example.

 

Thanks for your help.

 

Best

 

My code is:

#include <vector>
#include <iostream>
#include <CL/sycl.hpp>
using namespace cl::sycl;
std::vector<std::vector<double>> filter2d(const std::vector<double>& b, double a, const std::vector<std::vector<double>>& x) {
int rows = x.size();
int cols = x[0].size();
std::vector<std::vector<double>> y(x.size(), std::vector<double>(x[0].size()));
auto z = b.size();
std::vector<double> flat_y(rows * cols);
std::vector<double> flat_x(rows * cols);
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
flat_x[i * cols + j] = x[i][j];
}
}
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
flat_y[i * cols + j] = y[i][j];
}
}
sycl::buffer<double, 1> b_buffer(b.data(), range<1>(rows));
sycl::buffer<double, 2> x_buffer(flat_x.data(), range<2>(rows, cols));
sycl::buffer<double, 2> y_buffer(flat_y.data(), range<2>(rows, cols));

sycl::queue q(sycl::gpu_selector_v);
std::cout << "Device name: " << q.get_device().get_info<sycl::info::device::name>();

q.submit([&](sycl::handler& h) {
sycl::accessor x_acc(x_buffer, h);
sycl::accessor y_acc(y_buffer, h);
sycl::accessor b_acc(b_buffer, h);

auto out = sycl::stream(512, 256, h);
h.parallel_for(sycl::range{ static_cast<size_t>(rows), static_cast<size_t>(cols) }, [=](sycl::id<2> idx) {
int i = idx[0];
int j = idx[1];
y_acc[i][j] = 0.0;
for (int k = 0; k < z; k++)
{
if (i - k >= 0)
{
y_acc[i][j] = y_acc[i][j] + b_acc[k] * x_acc[(i - k)][j];
}
}
y_acc[i][j] = y_acc[i][j] / a;
});
}).wait();
sycl::host_accessor y_h(y_buffer);

for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
y[i][j] = y_h[i][j];
}
}

return y;
}
int main()
{
std::vector<double> b = { 1.0, 2.0, 1.0 };
double a = 1.0;
std::vector<std::vector<double>> x = {
{ 1.0, 2.0, 3.0 },
{ 4.0, 5.0, 6.0 },
{ 7.0, 8.0, 9.0 }
};
auto y = filter2d(b, a, x);
std::cout << "\n";
for (const auto& row : y) {
for (const auto& val : row) {
std::cout << val << " ";
}
std::cout << "\n";
}
return 0;
}

 

 

0 Kudos
8 Replies
lzy
Beginner
2,571 Views

I can run this code on another PC with GPU: Intel(R) UHD Graphics 630, Visual Studio version: Microsoft Visual Studio Community 2022 17.6.5。

0 Kudos
lzy
Beginner
2,563 Views

but on Intel(R) UHD Graphics 730. it turns out that it has the same problem as on Iris.

0 Kudos
NoorjahanSk_Intel
Moderator
2,468 Views

Hi,

 

Thanks for posting in Intel Communities.

We have reported this issue to the concerned development team. They are looking into your issue.

 

Thanks & Regards,

Noorjahan.

0 Kudos
NoorjahanSk_Intel
Moderator
2,356 Views

Hi,


Iris Xe Graphics doesn't support double precision.

We request you to change double to float data type so that the code works without any errors.

We will get back to you regarding Intel(R) UHD Graphics 730.


Thanks & Regards,

Noorjahan.



0 Kudos
NoorjahanSk_Intel
Moderator
2,217 Views

Hi,

 

Thanks for your patience.

 

Intel(R) UHD Graphics 730 also does not have native support for double precision

So we suggest you to change the double data type to float so that the code will work as expected without any exceptions.

Please let us know if you still face any issues.

 

Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
2,212 Views

Hi,

 

Thanks for your patience.

 

Intel(R) UHD Graphics 730 also does not have native support for double precision.

You can change the double data type to float so that the code will work as expected without any exceptions or you can export the below variables so that the code will work without any errors with the double data type.

export OverrideDefaultFP64Settings=1
export IGC_EnableDPEmulation=1

Please let us know if you still face any issues.

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
NoorjahanSk_Intel
Moderator
2,125 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
2,070 Views

Hi,


Since we didn't hear back from you, we assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Noorjahan.


0 Kudos
Reply