Is it possible to use bitset's functions in OpenACC region? An example code:
#include <string.h>
#include <bitset>
#pragma acc routine seq
int mystrcmp (const char *, const char *);
int main(int argc, char** argv)
{
long sum = 3, i;
std::bitset<11> vv;
char *str;
char *str2;
#pragma acc parallel loop reduction(+:sum)
for(i = 0; i<5000000000; ++i)
{
sum +=i%2;
if(i == 1){
mystrcmp(str, str2);
vv.count();
}
}
return 0;
}
int mystrcmp (const char *s1, const char *s2) {...}
If I compile the code above with pgc++ -fast -acc -Minfo=accel -ta=nvidia:managed -DNDEBUG -pgc++libs -g
and similars (LD_LIBRARY_PATH=/opt/pgi/linux86-64/lib), I get the following error: PGCC-S-0155-PGI support procedure called within a compute region: __blt_pgi_popcountl (proba2.cpp: 1288)
PGCC-S-0155-Accelerator region ignored; see -Minfo messages (proba2.cpp: 28)
main:
28, Accelerator region ignored
1288, Accelerator restriction: unsupported call to support routine '__blt_pgi_popcountl'
PGCC/x86 Linux 16.10-0: compilation completed with severe errors
, but the code consists of much less lines, than 1288.
I use mystrcmp because the built-in strcmp requires routine seq
, but according to the best of my knowledge, that is impossible to solve.
But, if the vv.count()
is commented out, then the compilation is success.
I read and searched a lot of about OpenACC and OpenACC problems, but I didn't find a corresponding response to this problem.
What should I do?
No, sorry, but we (PGI) haven't added runtime support for the "std::bitset" routines. Since this is the first request I seen for the feature, I submitted a new RFE (TPR#23746) and have sent it to our compiler engineers to see what we can do.