Hi, I'm developing an application using Qt framework and I have some difficulties using STL in offload region. As an example:
#pragma offload_attribute(push, target(mic)) #include <algorithm> #pragma offload_attribute(pop) void main() { float a = 0.1f; float b = 0.5f; float c = std::max(a,b); #pragma offload target(mic) { float x = 0.1f; float y = 0.5f; float z = std::max(x,y); } }
This compiled without error. But if I include <QObject> before #pragma offload_attribute I get following error:
undefined reference to 'float const& std::max<float>(float const&, float const&)'
So I guess, that <algorithm> is included in <QObject> library and therefor not linked with mic code. But when I change the order and include <QObject> after <algorithm> I'm experiencing another errors:
function has not been declared with compatible "target" attribute function has not been declared with compatible "target" attribute function has not been declared with compatible "target" attribute function has not been declared with compatible "target" attribute *MIC* function has not been declared with compatible "target" attribute *MIC* function has not been declared with compatible "target" attribute *MIC* function has not been declared with compatible "target" attribute *MIC* function has not been declared with compatible "target" attribute undefined reference to 'std::operator|=(std::_los_Fmtflags&, std::_los_Fmtflags)' undefined reference to 'std::operator~(std::_los_Fmtflags)' undefined reference to 'std::operator&=(std::_los_Fmtflags&, std::_los_Fmtflags)' undefined reference to 'std::operator&(std::_los_Fmtflags, std::_los_Fmtflags)' undefined reference to 'std::operator|=(std::_los_Fmtflags&, std::_los_Fmtflags)' undefined reference to 'std::operator~(std::_los_Fmtflags)' undefined reference to 'std::opreator&=(std::_los_Fmtflags&, std::_los_Fmtflags)' undefined reference to 'QByteArray::swap(QByteArray&)' undefined reference to 'QString::swap(QString&)'
There is no problem using for example <complex> library in offload since it is not included in Qt libraries. I don't need to use Qt classes within offload region, but I'd like to use some STL functions. Any suggestions?
Thanks MK.