我可以在OpenACC中使用std :: bitset的函数吗?

时间:2017-02-05 12:18:51

标签: c++ openacc std-bitset

是否可以在OpenACC区域中使用bitset的功能? 示例代码:

#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) {...}

如果我使用pgc++ -fast -acc -Minfo=accel -ta=nvidia:managed -DNDEBUG -pgc++libs -g和similars(LD_LIBRARY_PATH = / opt / pgi / linux86-64 / lib)编译上面的代码,我会收到以下错误: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,但代码包含很多比1288更少的线。
我使用mystrcmp,因为内置的strcmp需要routine seq,但据我所知,这是不可能解决的。
但是,如果vv.count()被注释掉了,那么编译就会成功。
我读了很多关于OpenACC和OpenACC问题的内容,但我没有找到相应的回复。这个问题。
我该怎么办?

1 个答案:

答案 0 :(得分:2)

不,对不起,但是我们(PGI)没有为&#34; std :: bitset&#34;添加运行时支持。例程。由于这是我在该功能中看到的第一个请求,因此我提交了一份新的RFE(TPR#23746)并将其发送给我们的编译工程师,看看我们能做些什么。