3

是否可以在 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如果我用类似的代码(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问题的资料,但没有找到对应这个问题的回复。
我该怎么办?

4

1 回答 1

2

不,抱歉,我们 (PGI) 没有为“std::bitset”例程添加运行时支持。由于这是我看到的第一个功能请求,我提交了一个新的 RFE (TPR#23746) 并将其发送给我们的编译器工程师,看看我们能做什么。

于 2017-02-06T22:59:17.653 回答