- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have 2 projects, both of them are compiled by DPC++ compiler, the first one contains a kernel function, and is compiled as a static lib(it is correct as when compiled as exe, it can run). the other only has a main function and is compiled as a executable file which link the first one.(both of them use same main function)
However, I got a runtime error when I run the second one. I find this error come from the submit function.
template <typename T> event submit(T CGF _CODELOCPARAM(&CodeLoc)) {
_CODELOCARG(&CodeLoc);
event Event;
.......//other no related code
{
Event = submit_impl(CGF, CodeLoc);
}
return Event;
}
where submit_impl return a runtime error at memory.
My environment is DPC++ 2022 + vs2019 with i7-10610U CPU and UHD 630 graphics.
so, could anyone tell me what I miss?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for posting in Intel Communities.
Could you please share the sample reproducer code, so that we can reproduce the issue from our end?
Thanks & Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
you can just use the default DPC++ project on visual studio (static lib) to replay the same result.
int main() {
IntArray Iarray1, Iarray2,Iarray3;
initialize_array(Iarray1);
vector_add(Iarray1,Iarray2,Iarray3);
return 0;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
We have reported this issue to the concerned development team. They are looking into the issue.
Thanks & Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We can run the static library successfully by following the below steps:
1) Open Visual Studio and select the static DPC++ library project.
2) Create a dpcpp project as a static project.
3) Build the static project.
4) Create a new DPC++ project.
5) Create a new sample C++ file and copy the program2.cpp file as attached.
6) Open project properties>>Configuration properties>>VC++ Directories>> Library Directories(add the static library output path)
7) Open project properties>>configuration properties>>Linker>>General>>pass additional options to the device compiler>> (Add the static library output path)
please try using the above steps and let us know if you face any issues.
Thanks & Regards,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks, It seems the DPC++ static lib configuration is not same as normal C++ static lib.
now, It works correct!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Glad to know 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.

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