我可以在 OpenACC 中使用 std::bitset 的函数吗?
Can I use std::bitset's functions with OpenACC?
是否可以在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问题的信息,但我没有找到对这个问题的相应回应。
我该怎么办?
不,抱歉,但我们(PGI(尚未添加对"std::bitset"例程的运行时支持。 由于这是我看到的第一个功能请求,我提交了一个新的 RFE (TPR#23746(,并将其发送给我们的编译器工程师,看看我们能做什么。
- "error: no matching function for call to"构造函数错误
- 什么时候调用组成单元对象的析构函数
- 继承函数的重载解析
- 为什么随机数生成器不在void函数中随机化数字,而在main函数中随机化
- C++模板来检查友元函数的存在
- 递归函数计算序列中的平方和(并输出过程)
- 对RValue对象调用的LValue ref限定成员函数
- C++17复制构造函数,在std::unordereded_map上进行深度复制
- 将数组作为参数传递给函数安全吗?作为第三方职能部门,可以探索他们想要的之外的其他元素
- 在C++STL中是否有Polyval(Matlab函数)等价物?
- 为什么使用 "this" 指针调用派生成员函数?
- 关于 std::bitset 构造函数的几个问题?
- 找不到使用 bitset 实例化模板函数的有效方法
- std::bitset 哈希函数算法
- 我可以在 OpenACC 中使用 std::bitset 的函数吗?
- 将bitset成员函数count的输出放入vector很慢
- c++使用std::bitset组合哈希函数
- Bitset作为函数的返回值
- 如何为bitset编写一个类似make_pair的函数
- 在c++中通过函数给动态bitset赋位