- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi
The following test returns an undefined reference for the target code
#include <algorithm>
void test()
{
#pragma offload target(mic)
{
double a=1.0;
double b=1.0;
double c=std::max(a,b);
}
}
int main()
{
test();
}
icpc -openmp -offload-option,mic,ld,'-zdefs' micstl.cxx
/tmp/icpcwXQiLo.o: In function `__offload_entry_micstl_cxx_6test_11b7a23007ddafd41960e6289788656dicpc326259940ELibIR':
micstl.cxx:(.text+0x72): undefined reference to `double const& std::max<double>(double const&, double const&)'
icpc --version
icpc (ICC) 14.0.4 20140805
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.
Do I need to link to a specific library on the mic?
Thanks
Jamil
Link copiado
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
icpc should normally generate in-line code for std::max(), avoiding a library reference.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Pardon the delay, you probably already determined the system header <algorithm> requires decoration/declaration for inclusion in the coprocessor (target) compilation as follows:
#pragma offload_attribute (push, target(mic)) #include <algorithm> #pragma offload_attribute (pop)
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Hi Kevin
Thanks for the tip. I assume I can follow a similar approach for header only boost functionality.
Thanks
Jamil
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I'm not knowledgeable on Boost but I expect that's correct. Any headers containing function declarations used within the offload code will require this style of decoration/declaration. Let me know if you run into problems and I'll solicit help from our Developers.
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora