- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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();
});
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We haven't heard back from you. Could you please provide an update on your issue?
Thanks & Regards,
Hemanth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot. The code works.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page