- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to program the Xeon Phi in offload mode. The program below should just construct objects from the standard library on the card, but linking fails with the following error:
On the remote process, dlopen() failed. The error message sent back from the sink is /var/volatile/tmp/coi_procs/1/27843/load_lib/icpcoutdlt28i: undefined symbol: _ZNSt6vectorIdSaIdEEC1EmRKdRKS0_
offload error: cannot load library to the device 0 (error code 20)
On the sink, dlopen() returned NULL. The result of dlerror() is "/var/volatile/tmp/coi_procs/1/27843/load_lib/icpcoutdlt28i: undefined symbol: _ZNSt6vectorIdSaIdEEC1EmRKdRKS0_"
if compiled with:
icpc -openmp example.cpp
Looks like he is not finding the std library for the mic ..... whats the correct compilation line?
Dario
[cpp]#include<iostream>
#include<math.h>
#include<vector>
#include<omp.h>
__attribute__((target(mic))) void wrapper() {
std::vector<double> x(2,0.1), f(1);
}
int main () {
#pragma omp parallel sections
{
#pragma omp section
{
std::cout << "Executing on CPUs\n";
wrapper();
std::cout << "I am done on CPUs\n";
}
#pragma omp section
{
std::cout << "Executing on Xeon Phi\n";
#pragma offload target(mic)
{
wrapper();
}
std::cout << "I am done on Xeon Phi\n";
}
}
return 0;
}[/cpp]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compilation line is fine. Program needs to declare instances of headers for the MIC side. Change the include statements to something like this:
#pragma offload_attribute (push, target(mic))
#include<iostream>
#include<vector>
#pragma offload_attribute (pop)
You may need to add other includes within the offload_attribute as you expand the code within the offload sections.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! That did it :)

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