Intel® oneAPI Data Parallel C++
Support for Intel® oneAPI DPC++ Compiler, Intel® oneAPI DPC++ Library, Intel ICX Compiler , Intel® DPC++ Compatibility Tool, and GDB*
560 Discussions

Exception unhandled at Event = submit_impl(CGF, CodeLoc);

student4
Beginner
1,132 Views

Hi,

 

I have two files Library.lib and Main.cpp. Library.lib contains two files :  Sample1.cpp and Sample2.cpp.

In the Library.lib file, I am trying to access a function in Sample1.cpp from Sample2.cpp within the kernel scope. But the program throws an exception at queue.hpp -  > Event = submit_impl(CGF, CodeLoc); .

I appreciate your help.

Thank you.

0 Kudos
1 Solution
HemanthCH_Intel
Moderator
1,016 Views

Hi,

 

Thanks for posting in Intel Communities.

 

In sample2::trails3() function, could you please change the q.single_task() to h.single_task() in sample2.cpp. After changing it to the handler(h) instead of a queue(q), it works fine without any error as shown in the screenshot.

HemanthCH_Intel_0-1646659022122.png

 

Could you please try at your end? If this resolves your issue, make sure to accept this as a solution. This would help others with a similar issue. Thank you!

 

Thanks & Regards,

Hemanth.

 

View solution in original post

0 Kudos
5 Replies
student4
Beginner
1,130 Views

I am unable to attach Sample1.cpp and Sample2.cpp. Below, are the contents of the two files.

Sample1.cpp

 

#include "Sample1.h"

Sample1::Sample1()
{

}

Sample1::~Sample1()
{

}

void Sample1::trial()
{
int c = a + b;
}

void Sample1::trial2()
{
int d = a + b;
}

 

Sample2.cpp

 

#include "Sample2.h"
#include "Sample1.h"

Sample2::Sample2()
{

}

Sample2::~Sample2()
{

}

void Sample2::trial3()
{
std::vector<int>sym_indices(4);
std::vector<int>best_syms(7);
std::vector<int>Lptemp(7);
sycl::buffer sym_indicesBuff(sym_indices);
sycl::buffer best_symsBuff(best_syms);
sycl::buffer LpBuff(Lptemp);
// device selection
cl::sycl::ext::intel::fpga_emulator_selector d_selector;
// queue declaration
cl::sycl::queue q(d_selector);

q.submit([&](sycl::handler& h)
{

sycl::accessor sym_indicesAccess(sym_indicesBuff, h, sycl::read_only);
sycl::accessor best_symsAccess(best_symsBuff, h, sycl::read_only);
sycl::accessor LpAccessor(LpBuff, h, sycl::read_write);

q.single_task([=]() {

for (int i = 0; i < 7; i++)
{
LpAccessor[i] = best_symsAccess[i] + sym_indicesAccess[i];
}
Sample1 object;
object.trial();
});
});

}

0 Kudos
HemanthCH_Intel
Moderator
1,017 Views

Hi,

 

Thanks for posting in Intel Communities.

 

In sample2::trails3() function, could you please change the q.single_task() to h.single_task() in sample2.cpp. After changing it to the handler(h) instead of a queue(q), it works fine without any error as shown in the screenshot.

HemanthCH_Intel_0-1646659022122.png

 

Could you please try at your end? If this resolves your issue, make sure to accept this as a solution. This would help others with a similar issue. Thank you!

 

Thanks & Regards,

Hemanth.

 

0 Kudos
HemanthCH_Intel
Moderator
873 Views

Hi,


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


Thanks & Regards,

Hemanth.


0 Kudos
HemanthCH_Intel
Moderator
830 Views

Hi,


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,

Hemanth


0 Kudos
student4
Beginner
795 Views

Thanks a lot. The code works.

0 Kudos
Reply